json-model-compiler 2.0.50__tar.gz → 2.0.52__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/.github/workflows/sanity.yml +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/API.md +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/BACKLOG.md +44 -4
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/BENCH.md +25 -23
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/DEV.md +79 -9
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/Makefile +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/PKG-INFO +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/SPEC.md +1 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/TUTO.md +8 -6
- json_model_compiler-2.0.52/VERSION.md +842 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/about.sh +21 -7
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/clang.py +37 -338
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/convert.py +3 -0
- json_model_compiler-2.0.52/json_model/data/VERSION +1 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/jmc.pod +5 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/export.py +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/irep.py +15 -13
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/java.py +58 -7
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/javascript.py +41 -8
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/language.py +27 -16
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/objops.py +6 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/optim.py +55 -28
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/perl.py +33 -10
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/plpgsql.py +15 -7
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/predefs.py +31 -6
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/python.py +9 -4
- json_model_compiler-2.0.52/json_model/regex.py +320 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/c/Makefile +2 -2
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/c/json-model.c +601 -13
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/c/json-model.h +10 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/Makefile +8 -1
- json_model_compiler-2.0.52/json_model/runtime/java/env.sh +12 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/Runtime.java +10 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/pom.xml +5 -4
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/js/index.js +16 -4
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/Makefile.PL +2 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/lib/JSON/JsonModel.pm +37 -3
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/sql/META.json +3 -3
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/sql/json_model--2.0.sql +2 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/support.py +22 -3
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/script.py +22 -7
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/utils.py +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/xstatic.py +30 -26
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/PKG-INFO +1 -1
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/SOURCES.txt +1 -0
- json_model_compiler-2.0.50/VERSION.md +0 -796
- json_model_compiler-2.0.50/json_model/data/VERSION +0 -1
- json_model_compiler-2.0.50/json_model/runtime/java/env.sh +0 -10
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/.gitignore +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/.gitmodules +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/DESIGN.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/DOC.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/HOWTO.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/INTEGRATION.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/MANIFEST.in +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/PUBS.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/README.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/README.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/__init__.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/analyze.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/clang_entry.c +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/clang_free.c +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/clang_init.c +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/clang_pcre2_fun.c +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/clang_re2_fun.c +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/java_free.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/java_init.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/javascript_exe.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/javascript_foot.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/javascript_free.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/javascript_head.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/javascript_init.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/javascript_main.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/perl_entry.pl +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/perl_exe.pl +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/perl_free.pl +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/perl_init.pl +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/perl_main.pl +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/perl_pkg.pl +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/plpgsql_entry.sql +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/python_entry.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/python_exe.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/python_free.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/python_init.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/data/python_main.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/model.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/mtypes.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/recurse.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/resolver.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/Makefile +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/__init__.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/c/main.c +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/.gitignore +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/README.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/Checker.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/GSON.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/JSON.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/JSONP.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/Jackson.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/Main.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/Path.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/java/json_model/Report.java +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/js/README.md +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/js/main.js +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/js/package.json +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/.gitignore +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/Changes +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/LICENSE +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/MANIFEST +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/README +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/env.sh +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/ignore.txt +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/t/00-load.t +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/t/manifest.t +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/t/pod-coverage.t +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/t/pod.t +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/pl/xt/boilerplate.t +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/sql/Makefile +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/sql/json_model.control +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/runtime/types.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/submodel.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model/url_cache.py +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/dependency_links.txt +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/entry_points.txt +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/not-zip-safe +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/requires.txt +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/json_model_compiler.egg-info/top_level.txt +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/package.json +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/pyproject.toml +0 -0
- {json_model_compiler-2.0.50 → json_model_compiler-2.0.52}/setup.cfg +0 -0
|
@@ -249,7 +249,7 @@ This generated code exports 4 useful functions:
|
|
|
249
249
|
plus two parameters which must be `undef` for now.
|
|
250
250
|
|
|
251
251
|
The generated functions and runtime depends in `JSON::JsonModel`, `re::engine::RE2`,
|
|
252
|
-
`JSON::MaybeXS`
|
|
252
|
+
`JSON::MaybeXS` and `Algorithm::LUHN`.
|
|
253
253
|
|
|
254
254
|
For instance, generate a Perl module:
|
|
255
255
|
|
|
@@ -2,11 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Current Tasks
|
|
4
4
|
|
|
5
|
+
- [ ] tests: check more bad urls (eg bad %-escape)
|
|
6
|
+
- [ ] static: use combined type test and value extraction when available?
|
|
7
|
+
- [ ] irep: cleanup `propesc2.c` (and others) variable res set but not used
|
|
8
|
+
- [ ] c-backend: factor out str extraction in or-list in more cases
|
|
9
|
+
- [ ] export: generate a [katydid](https://katydid.github.io/) expression, for a compatible subset
|
|
10
|
+
- [ ] static: factor out common checks on `&` with shared constraints?
|
|
11
|
+
- [ ] front: generate valid minimal, maximal and random values from a model
|
|
12
|
+
- [ ] front: generate invalid minimal values from a model
|
|
13
|
+
- [ ] optim: simplify some '!=' cases
|
|
14
|
+
- [ ] spec: allow to _remove_ definitions, eg `{ "$stuff": {"/": "$foo"}}`
|
|
15
|
+
- [ ] static: check for common object part
|
|
16
|
+
- [ ] perf: add another loop over performance collection?
|
|
17
|
+
- [ ] models: update ir model wrt recent changes
|
|
18
|
+
- [ ] tests: add test with ir model? on the fly?
|
|
19
|
+
- [ ] front: handle yaml values as well as json
|
|
20
|
+
- [ ] perf: drop and/or merge identical results when comparing
|
|
5
21
|
- [ ] backend: check `mv-34/mu` test case which may require some normalization
|
|
6
22
|
- [ ] runtime: count graphemes instead of characters? for Java, see `java.text.BreakIterator`
|
|
7
23
|
- [ ] pr: improve JSTS test results alignment between all backends (wip)
|
|
8
|
-
- [ ] js-runtime: check stability of `.mo` extension (wip: issue reported)
|
|
9
|
-
- [ ] js-backend: remove useless braces and semi-colons
|
|
10
24
|
- [ ] front: add argument groups
|
|
11
25
|
- [ ] front: merge many internal options to trigrams
|
|
12
26
|
- [ ] perf: add stddev performance computation
|
|
@@ -42,7 +56,6 @@
|
|
|
42
56
|
- [ ] predefs: improve `$URI` and `$URL`
|
|
43
57
|
- [ ] backend: check leap-second support on `$DATETIME` and `$TIME`
|
|
44
58
|
- [ ] doc: add _known limitations_ stuff
|
|
45
|
-
- [ ] doc: improve developer documentation
|
|
46
59
|
- [ ] spec: restrict regex syntax to a smaller subset
|
|
47
60
|
- [ ] predefs: add `$SIMPLE_REGEX` for regex syntax subset?
|
|
48
61
|
- [ ] docker: enable user remap
|
|
@@ -120,6 +133,32 @@
|
|
|
120
133
|
- [ ] predefs: add country codes, eg `$COUNTRY $COUNTRY2 $COUNTRY3 $COUNTRYN`
|
|
121
134
|
- [ ] spec: be precise about predefs standard references, eg `$DATE` and co.
|
|
122
135
|
|
|
136
|
+
## Internship
|
|
137
|
+
|
|
138
|
+
- [ ] pr: read www, papers, spec… setup dev env, report issues
|
|
139
|
+
- [ ] pr: try tutorial, report issues and suggest improvements
|
|
140
|
+
- [ ] tests: add a few tests for jsonrpc model
|
|
141
|
+
- [ ] model: write a model for MCP
|
|
142
|
+
- [ ] tests: add a few tests for MCP model
|
|
143
|
+
- [ ] model: add a clean model for SAP UI5 tools?
|
|
144
|
+
- [ ] model: update and test `ri.model.json`
|
|
145
|
+
- [ ] export: generate ts interfaces
|
|
146
|
+
- [ ] tests: improve predef validators cross-language consistency
|
|
147
|
+
- [ ] tests: generate invalid minimal, maximal, random values
|
|
148
|
+
- [ ] tests: generate invalid values on each constraint
|
|
149
|
+
- [ ] backend: C and runtime with json-c
|
|
150
|
+
- [ ] backend: C++
|
|
151
|
+
- [ ] backend: go
|
|
152
|
+
- [ ] backend: php
|
|
153
|
+
- [ ] backend: ruby
|
|
154
|
+
- [ ] backend: rust
|
|
155
|
+
- [ ] backend: test and fix existing dart backend MR
|
|
156
|
+
- [ ] export: generate annotated java interfaces/classes?
|
|
157
|
+
- [ ] tool: jmc api in flask
|
|
158
|
+
- [ ] front: allow IR re-entrance?
|
|
159
|
+
- [ ] export: katydid?
|
|
160
|
+
- [ ] api: json model as a service backend with flask
|
|
161
|
+
|
|
123
162
|
## Re Do
|
|
124
163
|
|
|
125
164
|
- [ ] pr: publish web page
|
|
@@ -303,7 +342,8 @@
|
|
|
303
342
|
- [ ] design: documentation use case, with added _markdown description_
|
|
304
343
|
- [ ] pr: validation must be optimized for the valid case, as it is the most likely.
|
|
305
344
|
- [ ] case: use trafo in geo to have either 2 or 3 vectors, no mix.
|
|
345
|
+
- [ ] c-backend: consider [json-c](https://github.com/json-c/json-c)
|
|
306
346
|
- [ ] c-backend: consider [yyjson](https://github.com/ibireme/yyjson)
|
|
307
347
|
- [ ] c-backend: consider [cJSON](https://github.com/davegamble/cjson) (linked lists? no ints?…)
|
|
308
|
-
- [ ] c-backend: consider [
|
|
348
|
+
- [ ] ~c-backend: consider [Parson](https://github.com/kgabis/parson) (unmaintained?)~
|
|
309
349
|
- [ ] ~c-backend: consider [json.h](https://github.com/sheredom/json.h) (hmmm, linked lists)~
|
|
@@ -9,21 +9,24 @@ schema to model converter in C, JS, Java (GSON, Jackson and JSONP using Johnzon)
|
|
|
9
9
|
|
|
10
10
|
## Recent Artifacts
|
|
11
11
|
|
|
12
|
+
Overall, depending on the chosen metrics, the JSU converter and JMC C backend are 50 to 90%
|
|
13
|
+
faster than Blaze in these artifacts.
|
|
14
|
+
|
|
15
|
+
- [2026071000](benchmarks/2026071000.md) clang, no predefs, jsu 0.9.12/jmc 2.0.51 vs sbc 16.1.0, 11 runs, 1000 iterations.
|
|
16
|
+
- [2026070900](benchmarks/2026070900.md) clang, no predefs, jsu 0.9.11/jmc 2.0.51 vs sbc 16.1.0, 11 runs, 1000 iterations.
|
|
17
|
+
- [2026062200](benchmarks/2026062200.md) clang, no predefs, jsu 0.9.11/jmc 2.0.51 vs sbc 16.0.0, 11 runs, 1000 iterations.
|
|
18
|
+
- [2026062102](benchmarks/2026062102.md) clang, no predefs, jsu 0.9.10/jmc 2.0.50 vs sbc 16.0.0, 11 runs, 1000 iterations.
|
|
19
|
+
- [2026061700](benchmarks/2026061700.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 16.0.0, 11 runs, 1000 iterations.
|
|
20
|
+
- [2026061300](benchmarks/2026061300.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.11.0, 11 runs, 1000 iterations.
|
|
21
|
+
- [2026061000](benchmarks/2026061000.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.10.1, 11 runs, 1000 iterations.
|
|
22
|
+
- [2026061001](benchmarks/2026061001.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.10.0, 11 runs, 1000 iterations.
|
|
23
|
+
- [2026060900](benchmarks/2026060900.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.9.0, 11 runs, 1000 iterations.
|
|
24
|
+
- [2026060300](benchmarks/2026060300.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.8.0, 11 runs, 1000 iterations.
|
|
25
|
+
- [2026060200](benchmarks/2026060200.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.7.0, 11 runs, 1000 iterations.
|
|
26
|
+
- [2026052105](benchmarks/2026052105.md) clang, no predefs, jsu 0.9.9/jmc 2.0.50 vs sbc 15.6.3, 11 runs, 1000 iterations.
|
|
12
27
|
- [2026051900](benchmarks/2026051900.md) clang, no predefs, jsu 0.9.9/jmc 2.0.49 vs sbc 15.6.3, 11 runs, 1000 iterations.
|
|
13
28
|
- [2026051701](benchmarks/2026051701.md) clang, no predefs, jsu 0.9.9/jmc 2.0.49 vs sbc 15.6.2, 11 runs, 1000 iterations.
|
|
14
29
|
- [2026051200](benchmarks/2026051200.md) clang, no predefs, jsu 0.9.9/jmc 2.0.49 vs sbc 15.6.1, 11 runs, 1000 iterations.
|
|
15
|
-
- [2026050902](benchmarks/2026050902.md) clang, no predefs, jsu 0.9.9/jmc 2.0.49 vs sbc 15.6.0, 11 runs, 1000 iterations.
|
|
16
|
-
- [2026050900](benchmarks/2026050900.md) clang, no predefs, jsu 0.9.8/jmc 2.0b48 vs sbc 15.6.0, 11 runs, 1000 iterations.
|
|
17
|
-
- [2026050800](benchmarks/2026050800.md) clang, no predefs, jsu 0.9.8/jmc 2.0b48 vs sbc 15.5.0, 11 runs, 1000 iterations.
|
|
18
|
-
- [2026050703](benchmarks/2026050703.md) clang, no predefs, jsu 0.9.8/jmc 2.0b48 vs sbc 15.4.0, 11 runs, 1000 iterations.
|
|
19
|
-
- [2026050700](benchmarks/2026050700.md) clang, no predefs, jsu 0.9.6/jmc 2.0b46 vs sbc 15.4.0, 11 runs, 1000 iterations.
|
|
20
|
-
- [2026050304](benchmarks/2026050304.md) clang, no predefs, jsu 0.9.6/jmc 2.0b46 vs sbc 15.2.0, 11 runs, 1000 iterations.
|
|
21
|
-
- [2026042800](benchmarks/2026042800.md) clang, no predefs, jsu 0.9.6/jmc 2.0b45 vs sbc 15.2.0, 11 runs, 1000 iterations.
|
|
22
|
-
- [2026042700](benchmarks/2026042700.md) clang, no predefs, jsu 0.9.6/jmc 2.0b45 vs sbc 15.1.0, 11 runs, 1000 iterations.
|
|
23
|
-
- [2026042503](benchmarks/2026042503.md) clang, no predefs, jsu 0.9.6/jmc 2.0b45 vs sbc 15.0.0, 11 runs, 1000 iterations.
|
|
24
|
-
- [2026042500](benchmarks/2026042500.md) clang, no predefs, jsu 0.9.5/jmc 2.0b44 vs sbc 15.0.0, 11 runs, 1000 iterations.
|
|
25
|
-
- [2026042400](benchmarks/2026042400.md) clang, no predefs, jsu 0.9.4/jmc 2.0b43 vs sbc 15.0.0, 11 runs, 1000 iterations.
|
|
26
|
-
- [2026042001](benchmarks/2026042001.md) clang, no predefs, jsu 0.9.3/jmc 2.0b42 vs sbc 14.20.2, 11 runs, 1000 iterations.
|
|
27
30
|
|
|
28
31
|
## Benchmarking Script
|
|
29
32
|
|
|
@@ -74,20 +77,22 @@ the following caveats, and others:
|
|
|
74
77
|
- test cases may or may not be representative of specific use cases,
|
|
75
78
|
especially wrt schema/model and value sizes.
|
|
76
79
|
- the overall load on the test host can impact measures, as well as power control
|
|
77
|
-
features which adjust the cpu frequency in real time
|
|
80
|
+
features which adjust the cpu frequency in real time, thus the frequency may be set
|
|
81
|
+
explicitely, and effort are made to cap the load to limit its impact on measures.
|
|
78
82
|
- Relying on hyper-threading can reduce performance for simple one thread tasks,
|
|
79
83
|
so it is often disabled.
|
|
80
|
-
- the measure overhead is estimated and deduced from the performance figures,
|
|
81
|
-
which leads to potentially fuzzy results
|
|
84
|
+
- the measure overhead is estimated and deduced from the performance figures by default,
|
|
85
|
+
which leads to potentially fuzzy results when testing very small values.
|
|
82
86
|
- compilers, libraries and other design and updates can have dramatic effects:
|
|
83
87
|
for faster parsing, a library may use linked-list for properties, which means
|
|
84
88
|
that retrieving a given property value will cost more than a library which uses
|
|
85
89
|
a hash table which is more costly to build.
|
|
86
|
-
- blaze does _not_ implement checking string values (eg dates, url…),
|
|
90
|
+
- before version _16.0_, blaze does _not_ implement checking string values (eg dates, url…),
|
|
87
91
|
so these checks may be disactivated (see `JMC_OPTS`) for fairness,
|
|
88
92
|
reducing the results significance.
|
|
89
93
|
- blaze uses its own special-purpose JSON representation which include a precomputed
|
|
90
|
-
custom hash for string comparisons, aleviating the need to compare strings
|
|
94
|
+
custom hash for string comparisons, aleviating the need to actually compare strings
|
|
95
|
+
in most cases.
|
|
91
96
|
- blaze is a C++ library, if interfaced from another language, the cost of translating
|
|
92
97
|
the JSON representation to this library should be taken into account;
|
|
93
98
|
in contrast, jmc uses native JSON representations in the target ecosystem and generate
|
|
@@ -97,7 +102,7 @@ the following caveats, and others:
|
|
|
97
102
|
model definitions compared to lax schemas…
|
|
98
103
|
- it is unclear whether JIT optimizations (eg Java and JS) may work around the
|
|
99
104
|
benchmarking loops and report undue very fast performances, eg on the GeoJSON case.
|
|
100
|
-
- some execution environment (eg Java)
|
|
105
|
+
- some execution environment (eg Java) take advantage of parallelism with threads (possibly
|
|
101
106
|
for the garbage collector and JIT), which may or may not be a blessing: it can reduce
|
|
102
107
|
the apparent latency (eg the gc runs in another thread) but have a detrimental overall
|
|
103
108
|
effect on throughput and costs as more cpu ressources are spent on the same task.
|
|
@@ -114,8 +119,8 @@ C, JS and Python backends, using the `jsu-compile` command.
|
|
|
114
119
|
It should be noted that benchmarking conditions are quite different compared to our own:
|
|
115
120
|
|
|
116
121
|
1. There is no loop to compute an average performance, but an initial _cold_ one-shot measure,
|
|
117
|
-
a warming phase loop and a _hot_ one-shot measure:
|
|
118
|
-
occasional GC runs.
|
|
122
|
+
a warming phase loop (up to 1000 rounds, kept under 10 seconds) and a _hot_ one-shot measure:
|
|
123
|
+
This may tend to mask effects from occasional GC runs.
|
|
119
124
|
2. The benchmark focuses on schema conformance, including (buggy) schemas which
|
|
120
125
|
are mostly dead code: It rejects tools which do not validate all strictly conformant
|
|
121
126
|
values, even if these values would be rejected by the target application.
|
|
@@ -126,6 +131,3 @@ It should be noted that benchmarking conditions are quite different compared to
|
|
|
126
131
|
4. The benchmark _removes_ format assertions before testing schemas.
|
|
127
132
|
5. The model used are strictly converted from schemas, native models are not used
|
|
128
133
|
even if available and schemas are not fixed for typical errors (eg misplaced keywords).
|
|
129
|
-
|
|
130
|
-
As of May 2026, the JSU C implementation is faster than Blaze on about 60% of benchmark cases
|
|
131
|
-
on these artifacts.
|
|
@@ -6,7 +6,7 @@ Beware that the developer documentation is scarce. PR are always welcome, eg:
|
|
|
6
6
|
|
|
7
7
|
- new language or library support implementations
|
|
8
8
|
- new exporters
|
|
9
|
-
-
|
|
9
|
+
- new native models
|
|
10
10
|
- generated code optimizations
|
|
11
11
|
|
|
12
12
|
## Publication Accounts
|
|
@@ -41,26 +41,95 @@ git clone --recursive-submodules git@github.com:clairey-zx81/json-model.git
|
|
|
41
41
|
cd json-model
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
If you intend to develop and submit a PR, fork the repos before cloning.
|
|
44
|
+
If you intend to develop and submit a PR, fork the repos before cloning, and create a branch.
|
|
45
|
+
Use `pull` with `rebase` to ensure a linear commit history.
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
There are 3 branches:
|
|
48
|
+
|
|
49
|
+
- `main` for releases
|
|
50
|
+
- `post` for post-release changes
|
|
51
|
+
- `dev` for fixes and features
|
|
52
|
+
|
|
53
|
+
New things happen on `dev`, the are merged into `main` for release from time to time.
|
|
54
|
+
Branch `post` is used to add new benchmark artifacts out of the release cycle.
|
|
55
|
+
|
|
56
|
+
The `post`/`main` branches and `main` tags are needed so that automatic versioning works.
|
|
57
|
+
|
|
58
|
+
To setup a local developer environment, run at the root of the project, try `make dev`.
|
|
47
59
|
|
|
48
60
|
```sh
|
|
49
61
|
# for Python
|
|
50
|
-
make dev
|
|
62
|
+
make dev.py
|
|
51
63
|
source venv/bin/activate
|
|
52
64
|
# for JS
|
|
53
65
|
npm install
|
|
54
|
-
# for Perl
|
|
66
|
+
# for Perl, install dependencies, see "PREREQ_PM" in Makefile.PL, then:
|
|
55
67
|
source $PWD/json_model/runtime/pl/env.bash
|
|
56
68
|
# for Java
|
|
57
|
-
# get needed
|
|
58
|
-
make -C json_model/runtime/java jar
|
|
69
|
+
# get needed dependencies and compile jar
|
|
70
|
+
make -C json_model/runtime/java mvn.jar mvn.deps
|
|
59
71
|
source $PWD/json_model/runtime/java/env.bash
|
|
60
72
|
# for C
|
|
61
|
-
# install pcre2, cre2, gnu getopt, jansson
|
|
73
|
+
# install pcre2, cre2, gnu getopt, jansson, compile runtime
|
|
74
|
+
make -C json_model/runtime/c compile
|
|
62
75
|
# for SQL
|
|
63
|
-
# have psql ready to connect to a local Postgres
|
|
76
|
+
# have psql ready to connect to a local Postgres, and the permissions to
|
|
77
|
+
# create databases and install the `json_model` extension (for running tests).
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
It can be convenient to have a local `env.sh` (or similar) file at the root
|
|
81
|
+
of the project to setup the needed environment:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# File env.sh
|
|
85
|
+
source venv/bin/activate
|
|
86
|
+
source $PWD/json_model/runtime/pl/env.sh
|
|
87
|
+
source $PWD/json_model/runtime/java/env.sh
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Tests
|
|
91
|
+
|
|
92
|
+
Tests use `pytest`, possibly through `make`.
|
|
93
|
+
|
|
94
|
+
### Root directory
|
|
95
|
+
|
|
96
|
+
Python linting (not well maintained) and non regression tests
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
make check
|
|
100
|
+
make check.src # linting
|
|
101
|
+
make check.tests # tests
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Tests directory
|
|
105
|
+
|
|
106
|
+
Pytests tests inside `tests`
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
make check # run pytest tests in parallel
|
|
110
|
+
make check.check # regenerate all reference files
|
|
111
|
+
make clean.js js # regenerate javascript stuff
|
|
112
|
+
make clean.java java # regenerate java stuff
|
|
113
|
+
make clean.pl pl # regenerate pl stuff
|
|
114
|
+
make clean # remove intermediate files
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Example manual command:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pytest -n auto -k mv-22 tests.py
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Tests subdirectories
|
|
124
|
+
|
|
125
|
+
Subdirectories provide a parallel work unit:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
make gen # generate reference files
|
|
129
|
+
make check # regenerate reference files
|
|
130
|
+
make clean # remove intermediate files
|
|
131
|
+
make clean.js js # regenerate js stuff (and other languages)
|
|
132
|
+
make foo.CLEAN foo.ALL # clean/regenerate all stuff for case "foo"
|
|
64
133
|
```
|
|
65
134
|
|
|
66
135
|
## Code Doc
|
|
@@ -74,6 +143,7 @@ Section _The jmc Compiler_ is not too bad for an initial understanding.
|
|
|
74
143
|
Procedure for releasing a new python package version:
|
|
75
144
|
|
|
76
145
|
- consider releasing both JSU and JMC at the same time!
|
|
146
|
+
- consider testing bowtie and jsonschema-benchmark dockers with the dev branch
|
|
77
147
|
- merge `dev` changes into the `main` branch
|
|
78
148
|
- update `json_model/data/VERSION`, `BACKLOG.md` and `VERSION.md`
|
|
79
149
|
- `git commit` and `git tag` as new version
|
|
@@ -147,6 +147,7 @@ for all possible values for that type.
|
|
|
147
147
|
- `"$CARD"`: a credit card number with a Luhn checksum, eg _1234567890123452_
|
|
148
148
|
- `"$JSONPT"`: an RFC6901 json pointer, eg _/http:~1~1json-model.org_
|
|
149
149
|
- `"$TIMETZ"`: time with timezone
|
|
150
|
+
- `"$SEMVER"`: semantic versioning 2.0
|
|
150
151
|
|
|
151
152
|
Any other all-capital ASCII character and digit names must be rejected as they
|
|
152
153
|
are reserved for possible future predefs (eg URN, Luhn, ISBN, ISSN, EAN, DOI…).
|
|
@@ -249,7 +249,7 @@ jmc --name Pi Person-2 pi.json # PASS
|
|
|
249
249
|
A common use case is to define some data structure and to reuse them in other
|
|
250
250
|
related settings, much like one would _import_ a module or _include_ a header file.
|
|
251
251
|
JSON Model allows definitions to be local or remote URLs so as to fetch and reuse
|
|
252
|
-
external models easily.
|
|
252
|
+
external models easily. Here the `#` keyword is not a comment but a definition selector.
|
|
253
253
|
|
|
254
254
|
Let us write file `Class.model.json` which reuses `Person-2.model.json` by loading
|
|
255
255
|
it as a file (`$./Person-2`) for defining the class name and array of students:
|
|
@@ -320,7 +320,8 @@ jmc Loose moe.json # PASS
|
|
|
320
320
|
A common pattern is to allow several kind of object as some point in the data structure,
|
|
321
321
|
aka a _union_.
|
|
322
322
|
This can be expressed with a model involving either the special `^` (xor, one-of) or `|`
|
|
323
|
-
(or, any-of) property with an array of possible models.
|
|
323
|
+
(or, any-of) property with an array of possible models. A sample value stands for its whole type,
|
|
324
|
+
and its sign selects the range: -1.0 means any float, 0.0 non-negative, 1.0 strictly positive — likewise -1, 0, 1 for integers.
|
|
324
325
|
|
|
325
326
|
Let us consider the model in file `Geom.model.json`, which defines a coordinate (`coord`) as
|
|
326
327
|
a pair of numbers, and use it for point and segment objects:
|
|
@@ -328,15 +329,15 @@ a pair of numbers, and use it for point and segment objects:
|
|
|
328
329
|
```json
|
|
329
330
|
{
|
|
330
331
|
"#": "Geometrical Model",
|
|
331
|
-
"$": { "
|
|
332
|
+
"$": { "Coord": [ -1.0, -1.0 ] },
|
|
332
333
|
"^": [
|
|
333
334
|
{
|
|
334
335
|
"type": "_Point",
|
|
335
|
-
"data": "$
|
|
336
|
+
"data": "$Coord"
|
|
336
337
|
},
|
|
337
338
|
{
|
|
338
339
|
"type": "_Segment",
|
|
339
|
-
"data": [ "$
|
|
340
|
+
"data": [ "$Coord", "$Coord" ]
|
|
340
341
|
}
|
|
341
342
|
]
|
|
342
343
|
}
|
|
@@ -678,11 +679,12 @@ jmc -o Person.java Person-2 # Java class
|
|
|
678
679
|
jmc -o person.sql Person-2 # PL/pgSQL functions
|
|
679
680
|
```
|
|
680
681
|
|
|
682
|
+
If you have postgresql instance installed then:
|
|
681
683
|
Here is an example of checking JSONB values inside Postgres, by importing
|
|
682
684
|
JSON Model runtime and generated code:
|
|
683
685
|
|
|
684
686
|
```sh
|
|
685
|
-
sudo make -C json_model/runtime install # install runtime
|
|
687
|
+
sudo make -C json_model/runtime/sql install # install runtime
|
|
686
688
|
# OR: sudo pgxn install json_model
|
|
687
689
|
psql -f person.sql # load runtime and model checking functions
|
|
688
690
|
```
|