json-model-compiler 2.0b48__tar.gz → 2.0.50__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/.github/workflows/sanity.yml +18 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/.gitignore +2 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/BACKLOG.md +17 -9
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/BENCH.md +19 -21
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/DEV.md +30 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/Makefile +46 -17
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/PKG-INFO +4 -3
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/VERSION.md +61 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/about.sh +20 -6
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/__init__.py +2 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/clang.py +17 -21
- json_model_compiler-2.0.50/json_model/data/VERSION +1 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/jmc.pod +110 -58
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/java.py +2 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/javascript.py +1 -1
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/language.py +2 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/optim.py +26 -14
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/perl.py +20 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/plpgsql.py +13 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/Makefile +0 -3
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/c/Makefile +1 -1
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/c/json-model.c +29 -15
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/c/json-model.h +12 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/c/main.c +97 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/GSON.java +18 -5
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/Jackson.java +10 -13
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/Main.java +35 -1
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/pom.xml +11 -10
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/js/index.js +9 -1
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/js/main.js +26 -3
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/js/package.json +1 -1
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/Changes +2 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/lib/JSON/JsonModel.pm +25 -5
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/support.py +19 -1
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/script.py +115 -52
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/utils.py +15 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/xstatic.py +107 -60
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/PKG-INFO +4 -3
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/SOURCES.txt +1 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/requires.txt +3 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/pyproject.toml +4 -1
- json_model_compiler-2.0b48/json_model/.gitignore +0 -1
- json_model_compiler-2.0b48/json_model/data/VERSION +0 -1
- json_model_compiler-2.0b48/json_model/version.py +0 -2
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/.gitmodules +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/API.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/DESIGN.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/DOC.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/HOWTO.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/INTEGRATION.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/MANIFEST.in +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/PUBS.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/README.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/SPEC.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/TUTO.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/README.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/analyze.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/convert.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/clang_entry.c +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/clang_free.c +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/clang_init.c +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/clang_pcre2_fun.c +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/clang_re2_fun.c +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/java_free.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/java_init.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/javascript_exe.js +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/javascript_foot.js +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/javascript_free.js +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/javascript_head.js +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/javascript_init.js +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/javascript_main.js +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/perl_entry.pl +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/perl_exe.pl +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/perl_free.pl +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/perl_init.pl +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/perl_main.pl +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/perl_pkg.pl +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/plpgsql_entry.sql +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/python_entry.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/python_exe.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/python_free.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/python_init.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/data/python_main.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/export.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/irep.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/model.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/mtypes.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/objops.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/predefs.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/python.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/recurse.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/resolver.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/__init__.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/.gitignore +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/Makefile +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/README.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/env.sh +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/Checker.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/JSON.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/JSONP.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/Path.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/Report.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/java/json_model/Runtime.java +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/js/README.md +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/.gitignore +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/LICENSE +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/MANIFEST +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/Makefile.PL +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/README +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/env.sh +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/ignore.txt +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/t/00-load.t +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/t/manifest.t +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/t/pod-coverage.t +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/t/pod.t +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/pl/xt/boilerplate.t +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/sql/META.json +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/sql/Makefile +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/sql/json_model--2.0.sql +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/sql/json_model.control +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/runtime/types.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/submodel.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model/url_cache.py +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/dependency_links.txt +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/entry_points.txt +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/not-zip-safe +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/json_model_compiler.egg-info/top_level.txt +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/package.json +0 -0
- {json_model_compiler-2.0b48 → json_model_compiler-2.0.50}/setup.cfg +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: JMC Sanity Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, dev, post ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checkout project
|
|
12
|
+
uses: actions/checkout@v6
|
|
13
|
+
- name: Set up Python
|
|
14
|
+
uses: actions/setup-python@v6
|
|
15
|
+
- name: Install Package Stuff
|
|
16
|
+
run: make dev.py
|
|
17
|
+
- name: Sanity Check
|
|
18
|
+
run: make check.sanity
|
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## Current Tasks
|
|
4
4
|
|
|
5
|
+
- [ ] backend: check `mv-34/mu` test case which may require some normalization
|
|
6
|
+
- [ ] runtime: count graphemes instead of characters? for Java, see `java.text.BreakIterator`
|
|
7
|
+
- [ ] 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
|
+
- [ ] front: add argument groups
|
|
11
|
+
- [ ] front: merge many internal options to trigrams
|
|
12
|
+
- [ ] perf: add stddev performance computation
|
|
13
|
+
- [ ] perf: improve resilience to bad overhead estimation
|
|
14
|
+
- [ ] perf: collect JSON parse times for comparison with validation times
|
|
15
|
+
- [ ] perf: keep only one java run?
|
|
16
|
+
- [ ] perf: check median hack for run times
|
|
17
|
+
- [ ] perf: show schema to model conversion times
|
|
18
|
+
- [ ] pr: better document optimizations, eg add compilier optimization page
|
|
5
19
|
- [ ] optim: collect and display stats about what works
|
|
6
20
|
- [ ] c-backend: improve unique with hash using int set?
|
|
7
21
|
- [ ] c-backend: improve str hash?
|
|
8
|
-
- [ ] perf: show schema to model conversion times
|
|
9
|
-
- [ ] js-backend: remove useless braces and semi-colons
|
|
10
22
|
- [ ] c-backend: use str cmp for ends with optimization as well
|
|
11
23
|
- [ ] c-backend: improve partitioned cset prettyprinting
|
|
12
24
|
- [ ] c-backend: use str set partitioning
|
|
@@ -18,6 +30,7 @@
|
|
|
18
30
|
- [ ] c-backend: use knowledge of Jansson hash to improve property lookup??
|
|
19
31
|
- [ ] c-backend: generate custom character class ascii tables?
|
|
20
32
|
- [ ] c-backend: custom char classes: `[:-] [a-zA-Z0-9_\\.\\-\\|@#] [a-zA-Z_$] [a-zA-Z0-9_\\-] [a-zA-Z0-9_.:-]`
|
|
33
|
+
- [ ] c-backend: handle small char classes?
|
|
21
34
|
- [ ] optim: remove props which match the default, in some cases?
|
|
22
35
|
- [ ] optim: regex list of words to enum?
|
|
23
36
|
- [ ] static: improve startswith pattern recognition `/^xyz.*/`
|
|
@@ -43,6 +56,7 @@
|
|
|
43
56
|
- [ ] static: take into account str _byte_ len when partitioning
|
|
44
57
|
- [ ] static: possibly use up to 8 bytes when hashing?
|
|
45
58
|
- [ ] static: fix hash size to depends on byte encoding, not str len
|
|
59
|
+
- [ ] static: check discriminator first? it help only if it appears first in the values
|
|
46
60
|
- [ ] perf: test partitioning for js, java, perl, python…
|
|
47
61
|
- [ ] perf: investigate best settings for js, java and python
|
|
48
62
|
- [ ] perf: allow to run with any docker image
|
|
@@ -101,7 +115,6 @@
|
|
|
101
115
|
- [ ] command: allow to pass some options from rc file?
|
|
102
116
|
- [ ] tests: parallelize per-case instead of per-dir?
|
|
103
117
|
- [ ] static: shorten xor exit?
|
|
104
|
-
- [ ] perf: profile some cases
|
|
105
118
|
- [ ] c-backend: use vector instructions for larger strcmp?
|
|
106
119
|
- [ ] export: sqlalchemy
|
|
107
120
|
- [ ] predefs: add country codes, eg `$COUNTRY $COUNTRY2 $COUNTRY3 $COUNTRYN`
|
|
@@ -156,8 +169,6 @@
|
|
|
156
169
|
- [ ] py-backend: heterogeneous enum (`enum_05`) improved implementation with `ConstSet`
|
|
157
170
|
- [ ] py-backend: heterogeneous disjunction with `ConstMap`?
|
|
158
171
|
- [ ] py-backend: unique for scalars (`set` only works for str)
|
|
159
|
-
- [ ] c-backend: optimize unique for scalar types using `constant_t`
|
|
160
|
-
- [ ] c-backend: remove path build under no reporting code gen
|
|
161
172
|
- [ ] static: make loose/strict work locally, triggered by `$name` root comments
|
|
162
173
|
- [ ] optim: root xor should be simplified in `geo.model.json`, maybe with inlining?
|
|
163
174
|
- [ ] python: how to keep looseness after inlining?
|
|
@@ -168,7 +179,6 @@
|
|
|
168
179
|
- [ ] design: add `$URI-REF` or similar? `$PATH`?
|
|
169
180
|
- [ ] c-backend: add reporting to predef failures?
|
|
170
181
|
- [ ] c-backend: generate thread-safe code? option? this currently would require malloc'ed stuff
|
|
171
|
-
- [ ] backend: what about a specialize IR [Blaze](https://arxiv.org/abs/2503.02770)?
|
|
172
182
|
- [ ] tests: put generated exe in `/dev/shm` instead of locally from `Makefile`?
|
|
173
183
|
- [ ] static: improve constraint failing message (length, unique…)
|
|
174
184
|
- [ ] schema: inline external references to generate working schemas in more cases? (openapi-311)
|
|
@@ -203,7 +213,6 @@
|
|
|
203
213
|
- [ ] backend: rethink `with_report` and `with_path`, keep the former only?
|
|
204
214
|
- [ ] c-backend: add support for `re2` wrapper?
|
|
205
215
|
- [ ] backend: name-based selector optimized for root.
|
|
206
|
-
- [ ] perfs: measure performance against blaze benchmark for openapi at least
|
|
207
216
|
- [ ] python: refactor in preproc tools…
|
|
208
217
|
- [ ] optim: remove unused introduced names `__external_...`
|
|
209
218
|
- [ ] optim: remove unused names at depth 1 and more?
|
|
@@ -257,7 +266,6 @@
|
|
|
257
266
|
- [ ] perf: schema validation on yac data
|
|
258
267
|
- [ ] perf: open data, eg RNCP and FRESQ
|
|
259
268
|
- [ ] frontend: loop load/valid for perf
|
|
260
|
-
- [ ] perf: reuse blaze data set where possible (implies schema to model)
|
|
261
269
|
- [ ] design: conditionals or not conditionals… eg for interfaces?
|
|
262
270
|
if not in the description language, it should be easy to express outside.
|
|
263
271
|
- [ ] doc: create a clean documentation, following Diátaxis (tuto | howto / explain | reference).
|
|
@@ -276,7 +284,7 @@
|
|
|
276
284
|
- [ ] rust-backend: see [json crate](https://docs.rs/json/latest/json/).
|
|
277
285
|
- [ ] cpp-backend: see [json](https://github.com/nlohmann/json) and `re2`. json lib popularity?
|
|
278
286
|
- [ ] cpp-backend: also see [simdjson](https://github.com/simdjson/simdjson)?
|
|
279
|
-
- [ ] backend:
|
|
287
|
+
- [ ] blaze-backend: use schema export plus simple cpp front or `jsonschema` cli?
|
|
280
288
|
- [ ] kotlin-backend: see [serialization](https://kotlinlang.org/docs/serialization.html).
|
|
281
289
|
- [ ] mongodb-backend: generate bson stuff, as an option to schema generation?
|
|
282
290
|
- [ ] ts-backend: js sharing ?
|
|
@@ -9,6 +9,13 @@ schema to model converter in C, JS, Java (GSON, Jackson and JSONP using Johnzon)
|
|
|
9
9
|
|
|
10
10
|
## Recent Artifacts
|
|
11
11
|
|
|
12
|
+
- [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
|
+
- [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
|
+
- [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.
|
|
12
19
|
- [2026050700](benchmarks/2026050700.md) clang, no predefs, jsu 0.9.6/jmc 2.0b46 vs sbc 15.4.0, 11 runs, 1000 iterations.
|
|
13
20
|
- [2026050304](benchmarks/2026050304.md) clang, no predefs, jsu 0.9.6/jmc 2.0b46 vs sbc 15.2.0, 11 runs, 1000 iterations.
|
|
14
21
|
- [2026042800](benchmarks/2026042800.md) clang, no predefs, jsu 0.9.6/jmc 2.0b45 vs sbc 15.2.0, 11 runs, 1000 iterations.
|
|
@@ -17,17 +24,6 @@ schema to model converter in C, JS, Java (GSON, Jackson and JSONP using Johnzon)
|
|
|
17
24
|
- [2026042500](benchmarks/2026042500.md) clang, no predefs, jsu 0.9.5/jmc 2.0b44 vs sbc 15.0.0, 11 runs, 1000 iterations.
|
|
18
25
|
- [2026042400](benchmarks/2026042400.md) clang, no predefs, jsu 0.9.4/jmc 2.0b43 vs sbc 15.0.0, 11 runs, 1000 iterations.
|
|
19
26
|
- [2026042001](benchmarks/2026042001.md) clang, no predefs, jsu 0.9.3/jmc 2.0b42 vs sbc 14.20.2, 11 runs, 1000 iterations.
|
|
20
|
-
- [2026040700](benchmarks/2026040700.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.20.2, 11 runs, 1000 iterations.
|
|
21
|
-
- [2026040400](benchmarks/2026040400.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.19.0, 11 runs, 1000 iterations.
|
|
22
|
-
- [2026040300](benchmarks/2026040300.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.18.0, 11 runs, 1000 iterations.
|
|
23
|
-
- [2026040200](benchmarks/2026040200.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.17.1, 11 runs, 1000 iterations.
|
|
24
|
-
- [2026032801](benchmarks/2026032801.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.17.0, 11 runs, 1000 iterations.
|
|
25
|
-
- [2026032700](benchmarks/2026032700.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.16.2, 11 runs, 1000 iterations.
|
|
26
|
-
- [2026032500](benchmarks/2026032500.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.16.1, 11 runs, 1000 iterations.
|
|
27
|
-
- [2026031900](benchmarks/2026031900.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.16.0, 11 runs, 1000 iterations.
|
|
28
|
-
- [2026031400](benchmarks/2026031400.md) clang, no predefs, jsu 0.9.2/jmc 2.0b41 vs sbc 14.14.2, 11 runs, 1000 iterations.
|
|
29
|
-
- [2026031300](benchmarks/2026031300.md) clang, no predefs, jsu 0.9.1/jmc 2.0b40 vs sbc 14.14.2, 11 runs, 1000 iterations.
|
|
30
|
-
- [2026031000](benchmarks/2026031000.md) clang, no predefs, jsu 0.9.1/jmc 2.0b39 vs sbc 14.14.2, 11 runs, 1000 iterations.
|
|
31
27
|
|
|
32
28
|
## Benchmarking Script
|
|
33
29
|
|
|
@@ -67,8 +63,7 @@ the run stops as soon as possible.
|
|
|
67
63
|
|
|
68
64
|
- To smooth out the wide range of collected performances (from 10 ns to
|
|
69
65
|
over 300 µs for validating one value), a relative comparison ratio is shown.
|
|
70
|
-
- Compilation times are the
|
|
71
|
-
whereas performance times are the _median_ over the runs.
|
|
66
|
+
- Compilation times and performance times are the _median_ encountered over the runs.
|
|
72
67
|
|
|
73
68
|
Note that performance figures **must** be taken with a pinch of salt, please consider
|
|
74
69
|
the following caveats, and others:
|
|
@@ -78,7 +73,10 @@ the following caveats, and others:
|
|
|
78
73
|
benchmark actually measure raw latency.
|
|
79
74
|
- test cases may or may not be representative of specific use cases,
|
|
80
75
|
especially wrt schema/model and value sizes.
|
|
81
|
-
- the overall load on the test host can impact measures
|
|
76
|
+
- 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.
|
|
78
|
+
- Relying on hyper-threading can reduce performance for simple one thread tasks,
|
|
79
|
+
so it is often disabled.
|
|
82
80
|
- the measure overhead is estimated and deduced from the performance figures,
|
|
83
81
|
which leads to potentially fuzzy results on very small data and schemas.
|
|
84
82
|
- compilers, libraries and other design and updates can have dramatic effects:
|
|
@@ -89,7 +87,7 @@ the following caveats, and others:
|
|
|
89
87
|
so these checks may be disactivated (see `JMC_OPTS`) for fairness,
|
|
90
88
|
reducing the results significance.
|
|
91
89
|
- blaze uses its own special-purpose JSON representation which include a precomputed
|
|
92
|
-
custom hash for string comparisons.
|
|
90
|
+
custom hash for string comparisons, aleviating the need to compare strings in most cases.
|
|
93
91
|
- blaze is a C++ library, if interfaced from another language, the cost of translating
|
|
94
92
|
the JSON representation to this library should be taken into account;
|
|
95
93
|
in contrast, jmc uses native JSON representations in the target ecosystem and generate
|
|
@@ -99,10 +97,10 @@ the following caveats, and others:
|
|
|
99
97
|
model definitions compared to lax schemas…
|
|
100
98
|
- it is unclear whether JIT optimizations (eg Java and JS) may work around the
|
|
101
99
|
benchmarking loops and report undue very fast performances, eg on the GeoJSON case.
|
|
102
|
-
- some execution environment (eg Java)
|
|
103
|
-
which may or may not be a blessing: it can reduce
|
|
104
|
-
in another thread) but have a detrimental overall
|
|
105
|
-
more cpu ressources are spent on the same task.
|
|
100
|
+
- some execution environment (eg Java) takes advantage of parallelism with threads (possibly
|
|
101
|
+
for the garbage collector and JIT), which may or may not be a blessing: it can reduce
|
|
102
|
+
the apparent latency (eg the gc runs in another thread) but have a detrimental overall
|
|
103
|
+
effect on throughput and costs as more cpu ressources are spent on the same task.
|
|
106
104
|
|
|
107
105
|
## Other Artifacts
|
|
108
106
|
|
|
@@ -125,9 +123,9 @@ It should be noted that benchmarking conditions are quite different compared to
|
|
|
125
123
|
[edited](https://github.com/sourcemeta-research/jsonschema-benchmark/commit/ad109eb210c0939bd8393da28d8212f75c1c2d92),
|
|
126
124
|
especially to deal corner cases issues with `$ref` under version 7 and prior,
|
|
127
125
|
thus do not conform to the initial official schemas.
|
|
128
|
-
4. The benchmark _removes_ format assertions before testing
|
|
126
|
+
4. The benchmark _removes_ format assertions before testing schemas.
|
|
129
127
|
5. The model used are strictly converted from schemas, native models are not used
|
|
130
128
|
even if available and schemas are not fixed for typical errors (eg misplaced keywords).
|
|
131
129
|
|
|
132
|
-
As of May 2026, the JSU C implementation is faster than Blaze on about
|
|
130
|
+
As of May 2026, the JSU C implementation is faster than Blaze on about 60% of benchmark cases
|
|
133
131
|
on these artifacts.
|
|
@@ -68,3 +68,33 @@ source $PWD/json_model/runtime/java/env.bash
|
|
|
68
68
|
Read sources…
|
|
69
69
|
The magically-generated [deepwiki](https://deepwiki.com/clairey-zx81/json-model)
|
|
70
70
|
Section _The jmc Compiler_ is not too bad for an initial understanding.
|
|
71
|
+
|
|
72
|
+
## Release Procedure
|
|
73
|
+
|
|
74
|
+
Procedure for releasing a new python package version:
|
|
75
|
+
|
|
76
|
+
- consider releasing both JSU and JMC at the same time!
|
|
77
|
+
- merge `dev` changes into the `main` branch
|
|
78
|
+
- update `json_model/data/VERSION`, `BACKLOG.md` and `VERSION.md`
|
|
79
|
+
- `git commit` and `git tag` as new version
|
|
80
|
+
- run non-regression tests: `make -C tests check`, fix and squash if necessary
|
|
81
|
+
- `make clean.dev && make publish.py`
|
|
82
|
+
- test generated package(s) manually:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cd /tmp
|
|
86
|
+
python -m venv venv
|
|
87
|
+
source venv/bin/activate
|
|
88
|
+
pip install path-to-generated-package.tar.gz
|
|
89
|
+
jmc --version # should display the new version
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- if okay:
|
|
93
|
+
- push sources and tags: `git push && git push --tags`
|
|
94
|
+
- publish package(s): `twine upload dist/*`
|
|
95
|
+
- check `jsonschema-benchmark` container build
|
|
96
|
+
- check `bowtie` container build
|
|
97
|
+
|
|
98
|
+
Note: do not push non released stuff on branch `main`, only use `post` and `dev`
|
|
99
|
+
as only these name are supported by Python `packaging.version`.
|
|
100
|
+
Not following this rule breaks branch installation from git sources.
|
|
@@ -6,6 +6,7 @@ SHELL = /bin/bash
|
|
|
6
6
|
#
|
|
7
7
|
|
|
8
8
|
MODULE = json_model
|
|
9
|
+
TMP = /dev/shm
|
|
9
10
|
|
|
10
11
|
ifndef PYTHON
|
|
11
12
|
PYTHON = python
|
|
@@ -29,7 +30,14 @@ venv/.dist: venv/.dev
|
|
|
29
30
|
touch $@
|
|
30
31
|
|
|
31
32
|
.PHONY: dev
|
|
32
|
-
dev:
|
|
33
|
+
dev: dev.py dev.js dev.java dev.c
|
|
34
|
+
|
|
35
|
+
.PHONY: dev.py
|
|
36
|
+
dev.py: venv/.dev
|
|
37
|
+
|
|
38
|
+
.PHONY: dev.c
|
|
39
|
+
dev.c:
|
|
40
|
+
$(MAKE) -C json_model/runtime/c compile
|
|
33
41
|
|
|
34
42
|
.PHONY: dev.js
|
|
35
43
|
dev.js: node_modules
|
|
@@ -50,7 +58,6 @@ dev.java:
|
|
|
50
58
|
clean: clean.site
|
|
51
59
|
$(RM) *~ jmc.1
|
|
52
60
|
$(MAKE) -C tests clean
|
|
53
|
-
$(MAKE) -C json_model/runtime clean
|
|
54
61
|
|
|
55
62
|
.PHONY: clean.js
|
|
56
63
|
clean.js:
|
|
@@ -59,15 +66,20 @@ clean.js:
|
|
|
59
66
|
|
|
60
67
|
.PHONY: clean.site
|
|
61
68
|
clean.site:
|
|
62
|
-
$(RM) site/MODELS.md site/JMC.md site/ABOUT.md
|
|
69
|
+
$(RM) site/MODELS.md site/JMC.md site/ABOUT.md .about.md
|
|
63
70
|
|
|
64
71
|
.PHONY: clean.py
|
|
65
72
|
clean.py:
|
|
66
|
-
$(RM) -r .pytest_cache .ruff_cache dist venv *.egg-info *.dist-info build
|
|
73
|
+
$(RM) -r .pytest_cache .ruff_cache dist venv *.egg-info *.dist-info build
|
|
67
74
|
find . -type d -name __pycache__ | xargs $(RM) -r
|
|
68
75
|
|
|
76
|
+
.PHONY: clean.c
|
|
77
|
+
clean.c:
|
|
78
|
+
$(MAKE) -C json_model/runtime/c clean
|
|
79
|
+
|
|
69
80
|
.PHONY: clean.dev
|
|
70
|
-
clean.dev: clean clean.js clean.site clean.py
|
|
81
|
+
clean.dev: clean clean.js clean.site clean.py clean.c
|
|
82
|
+
$(MAKE) -C json_model/runtime clean
|
|
71
83
|
|
|
72
84
|
#
|
|
73
85
|
# CHECK
|
|
@@ -101,6 +113,28 @@ check.tests: dev
|
|
|
101
113
|
source venv/bin/activate
|
|
102
114
|
$(MAKE) -C tests check
|
|
103
115
|
|
|
116
|
+
.PHONY: check.sanity
|
|
117
|
+
check.sanity: venv/.dev
|
|
118
|
+
source venv/bin/activate
|
|
119
|
+
# test directory, model and value
|
|
120
|
+
tmp="$(TMP)/$${USER}/sanity"
|
|
121
|
+
mkdir -p $${tmp} || exit 1
|
|
122
|
+
echo "null" > $${tmp}/null.model.json
|
|
123
|
+
echo '"=42"' > $${tmp}/42.model.json
|
|
124
|
+
echo '""' > $${tmp}/str.model.json
|
|
125
|
+
echo -en "null\n42\n\"hello world!\"" > $${tmp}/values.jsonl
|
|
126
|
+
# compilation
|
|
127
|
+
jmc --version || exit 2
|
|
128
|
+
jmc -o $${tmp}/null.py $${tmp}/null.model.json || exit 2
|
|
129
|
+
jmc -o $${tmp}/42.py $${tmp}/42.model.json || exit 2
|
|
130
|
+
jmc -o $${tmp}/str.py $${tmp}/str.model.json || exit 2
|
|
131
|
+
# validation
|
|
132
|
+
$${tmp}/null.py --version || exit 3
|
|
133
|
+
$${tmp}/null.py --jsonl -T 10 --parse $${tmp}/values.jsonl || exit 3
|
|
134
|
+
$${tmp}/42.py --jsonl -T 10 --parse $${tmp}/values.jsonl || exit 3
|
|
135
|
+
$${tmp}/str.py --jsonl -T 10 --parse $${tmp}/values.jsonl || exit 3
|
|
136
|
+
# keep temporary directory…
|
|
137
|
+
|
|
104
138
|
#
|
|
105
139
|
# Docsify Web Site: https://json-model.org/
|
|
106
140
|
#
|
|
@@ -120,9 +154,11 @@ site/MODELS.md: Makefile models/
|
|
|
120
154
|
site/JMC.md: json_model/data/jmc.pod
|
|
121
155
|
pod2markdown $< > $@
|
|
122
156
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
157
|
+
# generate twice to include the about page in the counts
|
|
158
|
+
site/ABOUT.md: ./about.sh site/JMC.md site/MODELS.md
|
|
159
|
+
./$< > $@
|
|
160
|
+
./$< > .about.md
|
|
161
|
+
mv .about.md $@
|
|
126
162
|
|
|
127
163
|
jmc.1: json_model/data/jmc.pod dev
|
|
128
164
|
source venv/bin/activate
|
|
@@ -138,7 +174,7 @@ www: build.site
|
|
|
138
174
|
#
|
|
139
175
|
# PUBLICATION
|
|
140
176
|
#
|
|
141
|
-
# SITE
|
|
177
|
+
# SITE and SITEPATH are out of the git repository
|
|
142
178
|
-include local.mk
|
|
143
179
|
|
|
144
180
|
.PHONY: build.site
|
|
@@ -146,20 +182,13 @@ build.site: site/MODELS.md site/JMC.md site/ABOUT.md
|
|
|
146
182
|
|
|
147
183
|
.PHONY: publish.site
|
|
148
184
|
publish.site: build.site
|
|
185
|
+
# NOTE --delete: no, keep old benchmark pages archive on the site for now
|
|
149
186
|
rsync -avL --progress ./site/. $(SITE):$(SITEPATH)/.
|
|
150
187
|
ssh $(SITE) chmod a+rx $(SITEPATH) $(SITEPATH)/models $(SITEPATH)/benchmarks
|
|
151
188
|
ssh $(SITE) chmod a+r $(SITEPATH)/* $(SITEPATH)/models/* $(SITEPATH)/benchmarks/*
|
|
152
189
|
|
|
153
|
-
json_model/version.py:
|
|
154
|
-
{
|
|
155
|
-
echo "# this file is automatically generated, do not edit!"
|
|
156
|
-
echo "HASH: str = \"$$(git rev-parse --short HEAD)\""
|
|
157
|
-
} > $@
|
|
158
|
-
|
|
159
190
|
.PHONY: publish.py
|
|
160
191
|
publish.py: venv/.dist
|
|
161
|
-
$(RM) json_model/version.py
|
|
162
|
-
$(MAKE) json_model/version.py
|
|
163
192
|
source venv/bin/activate
|
|
164
193
|
python -m build
|
|
165
194
|
twine check dist/*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: json_model_compiler
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.0.50
|
|
4
4
|
Summary: JSON Model Tools
|
|
5
5
|
Author: Fabien Coelho, Claire Yannou-Medrala
|
|
6
6
|
License-Expression: CC0-1.0
|
|
@@ -18,13 +18,14 @@ Requires-Dist: validators
|
|
|
18
18
|
Requires-Dist: fqdn
|
|
19
19
|
Requires-Dist: json-schema-utils>=0.9.0
|
|
20
20
|
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: filelock; extra == "dev"
|
|
22
|
+
Requires-Dist: ipython; extra == "dev"
|
|
21
23
|
Requires-Dist: flake8; extra == "dev"
|
|
22
24
|
Requires-Dist: ruff; extra == "dev"
|
|
23
25
|
Requires-Dist: pyright; extra == "dev"
|
|
24
26
|
Requires-Dist: pytest; extra == "dev"
|
|
25
27
|
Requires-Dist: pytest-xdist[psutils]; extra == "dev"
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist: ipython; extra == "dev"
|
|
28
|
+
Requires-Dist: setuptools-git-versioning; extra == "dev"
|
|
28
29
|
Provides-Extra: dist
|
|
29
30
|
Requires-Dist: build; extra == "dist"
|
|
30
31
|
Requires-Dist: wheel; extra == "dist"
|
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# JSON Model Compiler Versions
|
|
2
2
|
|
|
3
|
+
## 2.0.50 2026-05-21
|
|
4
|
+
|
|
5
|
+
- [x] c-runtime: remove some warnings on build
|
|
6
|
+
- [x] front: reduce version display verbosity
|
|
7
|
+
- [x] doc: add release procedure section
|
|
8
|
+
- [x] doc: fix type in jmc pod file
|
|
9
|
+
- [x] test: and minimal working sanity test
|
|
10
|
+
- [x] dev: improve dev setup and cleanup
|
|
11
|
+
- [x] ci: add minimal CI configuration on GitHub
|
|
12
|
+
- [x] main: add parse time measure for Python, JS, C, Java, Perl
|
|
13
|
+
- [x] java-runtime: update to latest JSON libraries
|
|
14
|
+
- [x] js-runtime: bump version
|
|
15
|
+
- [x] pl-runtime: bump version
|
|
16
|
+
- [x] static: fix generated code order determinism (again)
|
|
17
|
+
- [x] utils: ~improve model recurse with optional context~ not needed
|
|
18
|
+
- [x] front: add options to control more optimization phases
|
|
19
|
+
- [x] perf: improve benchmark script to help with next task (`compare.py`)
|
|
20
|
+
- [x] perf: separate perf and show business
|
|
21
|
+
- [x] perf: rewrite perf as a shell load script + sql
|
|
22
|
+
- [x] perf: rewrite show as a python script
|
|
23
|
+
- [x] perf: improve and generalize performance comparison script
|
|
24
|
+
- [x] perf: update benchmark stuff to use new comparison script
|
|
25
|
+
- [x] front: add `--no-precompiled` option
|
|
26
|
+
- [x] front: add `--no-unique-optimize` option
|
|
27
|
+
- [x] perf: compare can use χ² test
|
|
28
|
+
- [x] perf: test with each optimizations disabled to mesure impact
|
|
29
|
+
- [x] perf: analyze identical generated files when comparing same language
|
|
30
|
+
- [x] backend: use current version instead of installed version in generated code
|
|
31
|
+
- [x] js-runtime: fix string length as a number of chars
|
|
32
|
+
- [x] static: allow do disable regex pattern matching
|
|
33
|
+
- [x] static: allow to disable function call shortcuts
|
|
34
|
+
- [x] c-runtime: accept time `24:00:00` (8601-1:2019/Amd 1:2022)
|
|
35
|
+
- [x] test: do not test `24:00:00` as time validators are unlikely to agree
|
|
36
|
+
- [x] container: remove `cstring` add, `cre2` master is now fixed
|
|
37
|
+
- [x] perf: allow to restrict reporting to a subset of tools
|
|
38
|
+
- [x] static: allow disabling more xstatic optimization
|
|
39
|
+
- [x] perf: add note about random frequency governor changes because of cpu temperature
|
|
40
|
+
- [x] perf: show median compilation time instead of min
|
|
41
|
+
- [x] perf: possibly mount jsb as a volume when benchmarking
|
|
42
|
+
- [x] c-runtime: move re header inclusion to `json-model.h`
|
|
43
|
+
- [x] pl-backend: better escape some characters
|
|
44
|
+
- [x] sql-backend: use string escape syntax
|
|
45
|
+
- [x] static: fix int constant comparison typing under loose ints
|
|
46
|
+
- [x] c-backend: fix handling of small chars when building integers
|
|
47
|
+
- [x] static: fix some prop name escaping on reporting
|
|
48
|
+
- [x] java-backend: large int constants need a "L" suffix
|
|
49
|
+
- [x] java-backend: fix long conversion with GSON
|
|
50
|
+
- [x] java-backend: fix GSON issue where null property values are considered missing
|
|
51
|
+
- [x] pl-backend: load "utf8" package to better deal with utf8 constants
|
|
52
|
+
- [x] perf: also add jsb sharing when using js-cli
|
|
53
|
+
- [x] java-runtime: fix GSON null when used in value sets
|
|
54
|
+
|
|
55
|
+
## 2.0.49 2026-05-09
|
|
56
|
+
|
|
57
|
+
- [x] front: cleanup obsolete versioning stuff
|
|
58
|
+
- [x] front: show dynamic version when under dev
|
|
59
|
+
- [x] pr: show static version when generating ABOUT page
|
|
60
|
+
- [x] pr: add documentation section in ABOUT page
|
|
61
|
+
- [x] front: workaround, allow to skip dynamic version recomputation
|
|
62
|
+
- [x] front: use semver
|
|
63
|
+
|
|
3
64
|
## 2.0b48 2026-05-07
|
|
4
65
|
|
|
5
66
|
- [x] static: unroll small array scans for simple type checks
|
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
# Generate a markdown report about the compiler sources
|
|
4
4
|
#
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
githash=$(git show --pretty=format:"%h on %cs" --no-patch)
|
|
7
|
+
|
|
8
|
+
if type jmc > /dev/null ; then
|
|
9
|
+
version=$(jmc --version)
|
|
10
|
+
git_version=$githash
|
|
11
|
+
else
|
|
12
|
+
read version < json_model/data/VERSION
|
|
13
|
+
git_version="$(git rev-parse --abbrev-ref HEAD) $githash"
|
|
14
|
+
fi
|
|
9
15
|
|
|
10
16
|
cat <<EOF
|
|
11
17
|
# About JSON Model
|
|
12
18
|
|
|
13
19
|
JSON Model is an on-going [research project](PUBS.md).
|
|
14
20
|
|
|
15
|
-
The following
|
|
21
|
+
The following data about version **$version** (\`$git_version\`) show that the compiler,
|
|
16
22
|
code generator and runtimes are quite small, but still heavily tested.
|
|
17
23
|
|
|
18
24
|
## Compiler Source Code
|
|
@@ -23,7 +29,8 @@ but excludes language-specific code generators.
|
|
|
23
29
|
EOF
|
|
24
30
|
|
|
25
31
|
cloc --md \
|
|
26
|
-
|
|
32
|
+
json_model/__init__.py \
|
|
33
|
+
json_model/analyze.py \
|
|
27
34
|
json_model/convert.py \
|
|
28
35
|
json_model/export.py \
|
|
29
36
|
json_model/predefs.py \
|
|
@@ -54,7 +61,7 @@ Language|files|blank|comment|code
|
|
|
54
61
|
EOF
|
|
55
62
|
|
|
56
63
|
cloc --md \
|
|
57
|
-
|
|
64
|
+
json_model/python.py \
|
|
58
65
|
json_model/data/*.py \
|
|
59
66
|
| tail -1 | sed "s/SUM:/Python/"
|
|
60
67
|
|
|
@@ -136,4 +143,11 @@ on a set of test vectors.
|
|
|
136
143
|
- total JSON model locs: _${model_locs}_
|
|
137
144
|
- number of test vector JSON values: _${n_values}_
|
|
138
145
|
- all tested JSON values (including models, generated schemas and test suite schemas): _${all_values}_
|
|
146
|
+
|
|
147
|
+
## Documentation
|
|
148
|
+
|
|
149
|
+
Documentation files, excluding benchmark results.
|
|
139
150
|
EOF
|
|
151
|
+
|
|
152
|
+
cloc --md site/*.md \
|
|
153
|
+
| sed -n -e '/^$/,$p' | head -4
|
|
@@ -5,14 +5,14 @@ from .mtypes import Jsonable
|
|
|
5
5
|
from .runtime.types import Report, EntryCheckFun
|
|
6
6
|
from .model import JsonModel
|
|
7
7
|
from .script import (
|
|
8
|
-
jmc_script,
|
|
8
|
+
jmc_script, jmc_version,
|
|
9
9
|
model_from_json, model_from_url, model_from_str,
|
|
10
10
|
model_checker, model_checker_from_url, model_checker_from_json,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
__ALL__ = [
|
|
14
14
|
Jsonable, Report, EntryCheckFun, JsonModel,
|
|
15
|
-
jmc_script,
|
|
15
|
+
jmc_script, jmc_version,
|
|
16
16
|
model_from_json, model_from_url, model_from_str,
|
|
17
17
|
model_checker, model_checker_from_url, model_checker_from_json,
|
|
18
18
|
]
|
|
@@ -48,10 +48,13 @@ def _str_cmp_chunk(s: str, chunk: bytes, size: int,
|
|
|
48
48
|
else:
|
|
49
49
|
x: str = ""
|
|
50
50
|
for b in chunk:
|
|
51
|
+
hexa = hex(b)[2:]
|
|
52
|
+
if len(hexa) == 1:
|
|
53
|
+
hexa = "0" + hexa
|
|
51
54
|
if little:
|
|
52
|
-
x =
|
|
55
|
+
x = hexa + x
|
|
53
56
|
else:
|
|
54
|
-
x +=
|
|
57
|
+
x += hexa
|
|
55
58
|
# adjust to 4/8 byte boundary
|
|
56
59
|
zeros = "00" * ((8 if size > 4 else 4) - len(x) // 2)
|
|
57
60
|
x = "0x" + ((zeros + x) if little else (x + zeros)) + ("LL" if size > 4 else "")
|
|
@@ -576,7 +579,7 @@ class CLangJansson(Language):
|
|
|
576
579
|
debug: bool = False,
|
|
577
580
|
with_path: bool = True, with_report: bool = True, with_comment: bool = True,
|
|
578
581
|
with_predef: bool = True, strcmp_opt: bool = True, regex_opt: bool = True,
|
|
579
|
-
inline: bool = True, with_hints: bool = True,
|
|
582
|
+
unique_opt: bool = True, inline: bool = True, with_hints: bool = True,
|
|
580
583
|
byte_order: str = "le", max_strcmp_cset: int = 64,
|
|
581
584
|
partition_threshold: int = 32, relib: str = "pcre2", int_t: str = "int64_t"
|
|
582
585
|
):
|
|
@@ -606,6 +609,7 @@ class CLangJansson(Language):
|
|
|
606
609
|
self._inline = "INLINE " if inline else ""
|
|
607
610
|
self._strcmp_opt = strcmp_opt
|
|
608
611
|
self._regex_opt = regex_opt
|
|
612
|
+
self._unique_opt = unique_opt
|
|
609
613
|
self._max_strcmp_cset = max_strcmp_cset
|
|
610
614
|
# NOTE not necessary equal to the one in CodeGenerator
|
|
611
615
|
self._partition_threshold = partition_threshold
|
|
@@ -619,17 +623,6 @@ class CLangJansson(Language):
|
|
|
619
623
|
#
|
|
620
624
|
def file_header(self, exe: bool = True) -> Block:
|
|
621
625
|
code: Block = super().file_header(exe)
|
|
622
|
-
code += [ "", "// regular expression engine" ]
|
|
623
|
-
if self._relib == "pcre2":
|
|
624
|
-
code += [
|
|
625
|
-
"#define PCRE2_CODE_UNIT_WIDTH 8",
|
|
626
|
-
"#include <pcre2.h>",
|
|
627
|
-
]
|
|
628
|
-
else:
|
|
629
|
-
code += [
|
|
630
|
-
"#include <stddef.h>",
|
|
631
|
-
"#include <cre2.h>",
|
|
632
|
-
]
|
|
633
626
|
code += [
|
|
634
627
|
r"",
|
|
635
628
|
r"#include <json-model.h>",
|
|
@@ -799,13 +792,16 @@ class CLangJansson(Language):
|
|
|
799
792
|
return super().check_call(name, val, path, is_ptr=is_ptr, is_raw=is_raw) # type: ignore
|
|
800
793
|
|
|
801
794
|
def check_unique(self, val: JsonExpr, titem: type|None, path: Var) -> BoolExpr:
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
795
|
+
if self._unique_opt:
|
|
796
|
+
# checking uniqueness is expensive, use specialized versions to help performance
|
|
797
|
+
fun = (
|
|
798
|
+
"jm_str_array_is_unique" if titem is str else
|
|
799
|
+
"jm_int_array_is_unique" if titem is int else
|
|
800
|
+
"jm_obj_array_is_unique" if titem is dict else
|
|
801
|
+
"jm_json_array_is_unique"
|
|
802
|
+
)
|
|
803
|
+
else:
|
|
804
|
+
fun = "jm_json_array_is_unique"
|
|
809
805
|
return f"{fun}({val}, {self.path(path)}, {self.rep()})"
|
|
810
806
|
|
|
811
807
|
def check_constraint(self, op: str, vop: int|float|str, val: JsonExpr, path: Var) -> BoolExpr:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.50
|