git.delta.rocks / jrsonnet / refs/commits / a2ae6ff1c0dc

difftreelog

doc: remove codegenerated-stdlib

Yaroslav Bolyukin2021-07-04parent: #c959f4d.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-evaluator/README.mddiffbeforeafterboth
before · crates/jrsonnet-evaluator/README.md
1# jrsonnet-evaluator23Interpreter for parsed jsonnet tree45## Standard library67jsonnet stdlib is embedded into evaluator, but there is different modes for this:89- `codegenerated-stdlib`10  - generates source code for reproducing stdlib AST ([Example](https://gist.githubusercontent.com/CertainLach/7b3149df556f3406f5e9368aaa9f32ec/raw/0c80d8ab9aa7b9288c6219a2779cb2ab37287669/a.rs))11  - fastest on interpretation, slowest on compilation (it takes more than 5 minutes to optimize them by llvm)12- `serialized-stdlib`13  - serializes standard library AST using serde14  - slower than `codegenerated-stdlib` at runtime, but have no compilation speed penality15- none16  - leaves only stdlib source code in binary, processing them same way as user supplied data17  - slowest (as it involves parsing of standard library source code)1819Because of `codegenerated-stdlib` compilation slowdown, `serialized-stdlib` is used by default2021### Benchmark2223Can also be run via `cargo bench`2425```markdown26# codegenerated-stdlib27test tests::bench_codegen   ... bench:     401,696 ns/iter (+/- 38,521)28# serialized-stdlib29test tests::bench_serialize ... bench:   1,763,999 ns/iter (+/- 76,211)30# none31test tests::bench_parse     ... bench:   7,206,164 ns/iter (+/- 1,067,418)32```3334## Intrinsics3536Some functions from stdlib are implemented as intrinsics3738### Intrinsic handling3940If indexed jsonnet object has field '__intrinsic_namespace__' of type 'string', then any not found field/method is resolved as `Val::Intrinsic(__intrinsic_namespace__, name)`