difftreelog
doc: rerun benchmarks (#157)
in: master
* ci: update sjsonnet for benchmark * doc: scratch benchmarks results * feat: another Rust jsonnet implementation appears! Ref: https://github.com/google/jsonnet/pull/1156 * chore: use jdk21-headless for sjsonnet * chore: fix go-jsonnet benchmarking * chore: increase default max-stack for rsjsonnet * chore: update sjsonnet to v0.4.10 * chore: update skipped benchmarks list * chore: rerun benchmarks
8 files changed
README.adocdiffbeforeafterboth--- a/README.adoc
+++ b/README.adoc
@@ -69,6 +69,7 @@
* https://github.com/google/jsonnet[C++];
* https://github.com/google/go-jsonnet/[Go];
* https://github.com/databricks/sjsonnet[Scala].
+* [NEW] https://github.com/eduardosm/rsjsonnet[Another Rust impl appears].
This implementation shows performance better than all existing implementations.
For more information see link:./docs/benchmarks.md[benchmarks]
docs/benchmarks.mddiffbeforeafterboth1# Benchmarks23There are multiple implementations of jsonnet implemented in different languages: Rust (this repo), [Go](https://github.com/google/go-jsonnet/), [Scala](https://github.com/databricks/sjsonnet), [C++](https://github.com/google/jsonnet), [Haskell](https://github.com/moleike/haskell-jsonnet).45For simplicity, I will call these implementations by the language of their implementation.67Unfortunately, I haven't managed to measure performance of Haskell implementation, because I wasn't able to build it, and there is no binaries published anywhere, so this implementation is omitted from the following benchmarks89<details>10<summary>Tested versions</summary>1112Go: Jsonnet commandline interpreter (Go implementation) v0.19.11314```15Jsonnet commandline interpreter (Go implementation) v0.19.11617jsonnet {<option>} <filename>1819Available options:20 -h / --help This message21 -e / --exec Treat filename as code22 -J / --jpath <dir> Specify an additional library search dir23 (right-most wins)24 -o / --output-file <file> Write to the output file rather than stdout25 -m / --multi <dir> Write multiple files to the directory, list files26 on stdout27 -c / --create-output-dirs Automatically creates all parent directories for28 files29 -y / --yaml-stream Write output as a YAML stream of JSON documents30 -S / --string Expect a string, manifest as plain text31 -s / --max-stack <n> Number of allowed stack frames32 -t / --max-trace <n> Max length of stack trace before cropping33 --version Print version3435Available options for specifying values of 'external' variables:36 Provide the value as a string:37 -V / --ext-str <var>[=<val>] If <val> is omitted, get from environment38 var <var>39 --ext-str-file <var>=<file> Read the string from the file40 Provide a value as Jsonnet code:41 --ext-code <var>[=<code>] If <code> is omitted, get from environment42 var <var>43 --ext-code-file <var>=<file> Read the code from the file4445Available options for specifying values of 'top-level arguments':46 Provide the value as a string:47 -A / --tla-str <var>[=<val>] If <val> is omitted, get from environment48 var <var>49 --tla-str-file <var>=<file> Read the string from the file50 Provide a value as Jsonnet code:51 --tla-code <var>[=<code>] If <code> is omitted, get from environment52 var <var>53 --tla-code-file <var>=<file> Read the code from the file5455Environment variables:56 JSONNET_PATH is a colon (semicolon on Windows) separated list of directories57 added in reverse order before the paths specified by --jpath (i.e. left-most58 wins). E.g. these are equivalent:59 JSONNET_PATH=a:b jsonnet -J c -J d60 JSONNET_PATH=d:c:a:b jsonnet61 jsonnet -J b -J a -J c -J d6263In all cases:64 <filename> can be - (stdin)65 Multichar options are expanded e.g. -abc becomes -a -b -c.66 The -- option suppresses option processing for subsequent arguments.67 Note that since filenames and jsonnet programs can begin with -, it is68 advised to use -- if the argument is unknown, e.g. jsonnet -- "$FILENAME".69```7071C++: Jsonnet commandline interpreter v0.19.17273```74Jsonnet commandline interpreter v0.19.17576jsonnet {<option>} <filename>7778Available options:79 -h / --help This message80 -e / --exec Treat filename as code81 -J / --jpath <dir> Specify an additional library search dir (right-most wins)82 -o / --output-file <file> Write to the output file rather than stdout83 -m / --multi <dir> Write multiple files to the directory, list files on stdout84 -y / --yaml-stream Write output as a YAML stream of JSON documents85 -S / --string Expect a string, manifest as plain text86 -s / --max-stack <n> Number of allowed stack frames87 -t / --max-trace <n> Max length of stack trace before cropping88 --gc-min-objects <n> Do not run garbage collector until this many89 --gc-growth-trigger <n> Run garbage collector after this amount of object growth90 --version Print version91Available options for specifying values of 'external' variables:92Provide the value as a string:93 -V / --ext-str <var>[=<val>] If <val> is omitted, get from environment var <var>94 --ext-str-file <var>=<file> Read the string from the file95Provide a value as Jsonnet code:96 --ext-code <var>[=<code>] If <code> is omitted, get from environment var <var>97 --ext-code-file <var>=<file> Read the code from the file98Available options for specifying values of 'top-level arguments':99Provide the value as a string:100 -A / --tla-str <var>[=<val>] If <val> is omitted, get from environment var <var>101 --tla-str-file <var>=<file> Read the string from the file102Provide a value as Jsonnet code:103 --tla-code <var>[=<code>] If <code> is omitted, get from environment var <var>104 --tla-code-file <var>=<file> Read the code from the file105Environment variables:106JSONNET_PATH is a colon (semicolon on Windows) separated list of directories added107in reverse order before the paths specified by --jpath (i.e. left-most wins)108E.g. JSONNET_PATH=a:b jsonnet -J c -J d is equivalent to:109JSONNET_PATH=d:c:a:b jsonnet110jsonnet -J b -J a -J c -J d111112In all cases:113<filename> can be - (stdin)114Multichar options are expanded e.g. -abc becomes -a -b -c.115The -- option suppresses option processing for subsequent arguments.116Note that since filenames and jsonnet programs can begin with -, it is advised to117use -- if the argument is unknown, e.g. jsonnet -- "$FILENAME".118```119120Scala:121122```123Missing argument: file <str>124Expected Signature: Sjsonnet 0.4.3125usage: sjsonnet [sjsonnet-options] script-file126 -i --interactive Run Mill in interactive mode, suitable for opening REPLs and taking user127 input128 -J --jpath <str> Specify an additional library search dir (right-most wins)129 -o --output-file <str> Write to the output file rather than stdout130 -m --multi <str> Write multiple files to the directory, list files on stdout131 -c --create-output-dirs Automatically creates all parent directories for files132 -y --yaml-stream Write output as a YAML stream of JSON documents133 -S --string Expect a string, manifest as plain text134 -V --ext-str <str> <var>[=<val>] Provide 'external' variable as string. 'If <val> is135 omitted, get from environment var <var>136 --ext-str-file <str> <var>=<file> Provide 'external' variable as string from the file137 -V --ext-code <str> <var>[=<code>] Provide 'external' variable as Jsonnet code. If <code> is138 omitted, get from environment var <var>139 --ext-code-file <str> <var>=<file> Provide 'external' variable as Jsonnet code from the file140 -A --tla-str <str> <var>[=<val>] Provide top-level arguments as string. 'If <val> is141 omitted, get from environment var <var>142 --tla-str-file <str> <var>=<file> Provide top-level arguments variable as string from the file143 -V --tla-code <str> <var>[=<val>] Provide top-level arguments as Jsonnet code. 'If <val> is144 omitted, get from environment var <var>145 --tla-code-file <str> <var>=<file> Provide top-level arguments variable as Jsonnet code from146 the file147 -n --indent <int> How much to indent your output JSON148 -p --preserve-order Preserves order of keys in the resulting JSON149 --strict Enforce some additional syntax limitations150 --yaml-out Write output as a YAML document151 file <str> The jsonnet file you wish to evaluate152 --yaml-debug Generate source line comments in the output YAML doc to make it easier to153 figure out where values come from.154 --no-static-errors Turn static errors into warnings155 --fatal-warnings Fail if any warnings were emitted156157158```159160</details>161162163## Real world164165### Graalvm CI166167> Note: No results for C++, takes longer than a hour168169<details>170<summary>Source</summary>171172```jsonnet173# Common174local common = import 'common.jsonnet';175local graal_common = import 'graal-common.json';176177# Compiler178local compiler = import 'compiler/ci/ci.jsonnet';179180# GraalWasm181local wasm = import 'wasm/ci/ci.jsonnet';182183# Espresso184local espresso = import 'espresso/ci/ci.jsonnet';185186# Regex187local regex = import 'regex/ci/ci.jsonnet';188189# SDK190local sdk = import 'sdk/ci/ci.jsonnet';191192# SubstrateVM193local substratevm = import 'substratevm/ci/ci.jsonnet';194195# Sulong196local sulong = import 'sulong/ci/ci.jsonnet';197198# Tools199local tools = import 'tools/ci/ci.jsonnet';200201# Truffle202local truffle = import 'truffle/ci/ci.jsonnet';203204# JavaDoc205local javadoc = import "ci_includes/publish-javadoc.jsonnet";206207# VM208local vm = import 'vm/ci/ci_includes/vm.jsonnet';209210local verify_ci = (import 'ci-check.libsonnet').verify_ci;211212{213 # Ensure that entries in common.jsonnet can be resolved.214 _checkCommon: (import 'common.jsonnet'),215 ci_resources:: (import 'ci-resources.libsonnet'),216 overlay: graal_common.ci.overlay,217 specVersion: "3",218 builds: [common.add_excludes_guard(b) for b in (219 compiler.builds +220 wasm.builds +221 espresso.builds +222 regex.builds +223 sdk.builds +224 substratevm.builds +225 sulong.builds +226 tools.builds +227 truffle.builds +228 javadoc.builds +229 vm.builds230 )],231 assert verify_ci(self.builds),232 // verify that the run-spec demo works233 assert (import "ci/ci_common/run-spec-demo.jsonnet").check(),234}235236```237</details>238239| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |240|:---|---:|---:|---:|---:|241| `Rust` | 122.0 ± 1.9 | 118.3 | 125.8 | 1.00 |242| `Go` | 1402.0 ± 31.8 | 1359.7 | 1480.9 | 11.49 ± 0.32 |243| `Scala` | 869.3 ± 9.6 | 852.0 | 889.4 | 7.12 ± 0.14 |244245### Kube-prometheus manifests246247<details>248<summary>Source</summary>249250```jsonnet251local kp =252 (import 'kube-prometheus/main.libsonnet') +253 // Uncomment the following imports to enable its patches254 // (import 'kube-prometheus/addons/anti-affinity.libsonnet') +255 // (import 'kube-prometheus/addons/managed-cluster.libsonnet') +256 // (import 'kube-prometheus/addons/node-ports.libsonnet') +257 // (import 'kube-prometheus/addons/static-etcd.libsonnet') +258 // (import 'kube-prometheus/addons/custom-metrics.libsonnet') +259 // (import 'kube-prometheus/addons/external-metrics.libsonnet') +260 // (import 'kube-prometheus/addons/pyrra.libsonnet') +261 {262 values+:: {263 common+: {264 namespace: 'monitoring',265 },266 },267 };268269{ 'setup/0namespace-namespace': kp.kubePrometheus.namespace } +270{271 ['setup/prometheus-operator-' + name]: kp.prometheusOperator[name]272 for name in std.filter((function(name) name != 'serviceMonitor' && name != 'prometheusRule'), std.objectFields(kp.prometheusOperator))273} +274// { 'setup/pyrra-slo-CustomResourceDefinition': kp.pyrra.crd } +275// serviceMonitor and prometheusRule are separated so that they can be created after the CRDs are ready276{ 'prometheus-operator-serviceMonitor': kp.prometheusOperator.serviceMonitor } +277{ 'prometheus-operator-prometheusRule': kp.prometheusOperator.prometheusRule } +278{ 'kube-prometheus-prometheusRule': kp.kubePrometheus.prometheusRule } +279{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +280{ ['blackbox-exporter-' + name]: kp.blackboxExporter[name] for name in std.objectFields(kp.blackboxExporter) } +281{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } +282// { ['pyrra-' + name]: kp.pyrra[name] for name in std.objectFields(kp.pyrra) if name != 'crd' } +283{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +284{ ['kubernetes-' + name]: kp.kubernetesControlPlane[name] for name in std.objectFields(kp.kubernetesControlPlane) }285{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +286{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +287{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) }288289```290</details>291292| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |293|:---|---:|---:|---:|---:|294| `Rust` | 113.2 ± 2.9 | 109.7 | 120.1 | 1.00 |295| `Go` | 2192.3 ± 25.1 | 2166.1 | 2262.2 | 19.36 ± 0.54 |296| `Scala` | 1117.5 ± 21.9 | 1075.8 | 1152.1 | 9.87 ± 0.31 |297| `C++` | 88573.2 ± 4833.2 | 84345.6 | 97409.2 | 782.15 ± 47.02 |298299## Benchmarks from C++ jsonnet (/perf_tests)300301### Large string join302303<details>304<summary>Source</summary>305306```jsonnet307{308 text: std.join(',', std.makeArray(76846, function(_) 'x')),309}310311```312</details>313314| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |315|:---|---:|---:|---:|---:|316| `Rust` | 7.4 ± 0.2 | 6.9 | 8.9 | 1.00 |317| `Go` | 117.4 ± 5.1 | 112.1 | 139.2 | 15.87 ± 0.85 |318| `Scala` | 373.1 ± 4.5 | 367.8 | 383.0 | 50.45 ± 1.70 |319| `C++` | 85.9 ± 2.1 | 82.1 | 90.1 | 11.62 ± 0.46 |320321### Large string template322323> Note: No results for Go, fails with os stack size exhausion324325| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |326|:---|---:|---:|---:|---:|327| `Rust` | 8.2 ± 0.3 | 7.3 | 9.4 | 1.00 |328| `Scala` | 423.8 ± 5.5 | 416.2 | 437.5 | 51.62 ± 2.00 |329| `C++` | 15292.1 ± 204.0 | 15070.1 | 15840.7 | 1862.69 ± 72.39 |330331### Realistic 1332333<details>334<summary>Source</summary>335336```jsonnet337local utils = {338 Func3(aaaaaaa, bbbbbbb, cccc)::339 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/%s/XXXXX/%s/XXXXXXXXXXXXXXX/%s'340 % [aaaaaaa, bbbbbbb, cccc],341};342343344local long_list = [345 '001xxxxxxxxxxxxxxx-xxx',346 '002xxxxxxxxxxxxxxxxxx-xxx',347 '003xxxxxxxxxxxxxxxx-xxxxxxx',348 '004xxxxxx-xxxxxx',349 '005xxxx-xxx-xxxx',350 '006xxx-xxx-xxxxxx',351 '007xxx-xxx-xxxx-xxxx',352 '008xxx-xxx-xxxx-xxxx-xxxxxxx',353 '009xxx-xxx-xxxxx-xxxx-xxxxxxx-xxxxxx',354 '010xxx-xxx-xxxx-xxxxxxx-xxxxxx-xxxxxxx',355 '011xxx-xxx-xxxxx-xxxxxxxx-xxxxxxx',356 '012xxx-xxx-xxxx-xxxxxxxx-xxxxxxx-xxxxxx',357 '013xxx-xxx-xxxx-xxxxxxxxxx',358 '014xxx-xxx-xxxxx-xxxxxx-xx',359 '015xxx-xxx-xxxxxx-xxxxxxx',360 '016xxx-xxx-xxxx-xxxxxxxx-xxxxx',361 '017xxx-xxx-xxxx-xxxxxxxxxxxxxxx',362 '018xxx-xxx-xxxx-xxxxxxxx-xxxxxxx-xxxxxxx',363 '019xxx-xxx-xxxx-xxxxxxxx-xx',364 '020xxx-xxx-xxxx-xxxxxxxxxxxxxxxx',365 '021xxx-xxx-xxxx-xxxxxxxx-xxxxxxxxxxxx-xxx',366 '022xxx-xxxx-xxxx-xxxx-xxxxxxx',367 '023xxx-xxxx-xxxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',368 '024xxx-xxx-xxxx-xxx-xxxx-xxxx-xxx-xxxxxxxxx',369 '025xxx-xxxx-xxxx-xxxxxxxxx',370 '026xxx-xxx-xxxx-xxx-xxxxxxx',371 '027xxx-xxx-xxxx-xxx-xxxxxxx',372 '028xxx-xxx-xxxx-xxxxxxxxxx',373 '029xxx-xxx-xxxx-xxxxxx',374 '030xxx-xxx-xxxx-xxx-xxxxxxx',375 '031xxx-xxx-xxxx-xxx-xxxxxxxx',376 '032xxx-xxx-xxxxx-xxxxxxxxxxxx-xxxxxxx',377 '033xxx-xxx-xxxx-xxx-xxxx-xxxx',378 '034xxx-xxx-xxxx-xxx-xxxxxxxx-xxxxxxxx',379 '035xxx-xxx-xxxx-xxxxxxx',380 '036xxx-xxx-xxxx-xxxxxxxx-xxxxxxx',381 '037xxx-xxx-xxxx-xxxxxx',382 '038xxx-xxx-xxxx-xxxxxxxxxx',383 '039xxxx-xxx-xxxx-xxxxxx-xxxxxx-xxxxxxx',384 '040xxx-xxx-xxxx-xxxxxx-xxxxxxx',385 '041xxxx-xxx-xxxx-xxxxxx-xx',386 '042xxx-xxx-xxxx-xxxxxxxxxxx',387 '043xxx-xxx-xxxx-xxxxxxxxxxx-xxxxxxx',388 '044xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxx',389 '045xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxx',390 '046xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxx',391 '047xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxxxxxx',392 '048xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxxxxxxx',393 '049xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxxxxxxxx',394 '050xxx-xxx-xxxxx-xxxxx-xxxxxxx',395 '051xxx-xxx-xxxx-xxxxx-xxxxxxxx-xxxxxx',396 '052xxx-xxx-xxxx-xxxxx-xx',397 '053xxx-xxx-xxxx-xxxx-xxxxxxx-xxx-xxxxxxx',398 '054xxx-xxx-xxxx-xxxx-xxxxxxx-xxx-xxxxxx',399 '055xxx-xxx-xxxx-xxx',400 '056xxx-xxx-xxxx-xxxxxxx-xxxxxxx',401 '057xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxxx',402 '058xxx-xxx-xxxx-xxxxxxxxx-xxxxxx-xxxxxxx',403 '059xxx-xxx-xxxx-xx-xxxxxxxxxxx-xxxxx',404 '060xxx-xxx-xxxx-xxxxxxxxxxxxxx-xxxxxxx',405 '061xxx-xxx-xxxx-xxxxxxxx-xxxxxxx',406 '062xxx-xxx-xxxx-xxxxxxxxxxxxx-xxxxxxx',407 '063xxx-xxx-xxxx-xxxxxx-xxxxxxx',408 '064xxx-xxx-xxxxx-xxxxxx-xxxxxxx',409 '065xxx-xxx-xxxx-xxxxx-xxxxx',410 '066xxx-xxx-xxxx-xxxxx-xxxx',411 '067xxx-xxx-xxxx-xxxxxxxxxxxxxxxxx',412 '068xxx-xxx-xxxx-xxxxxxxx-xxxxx-xxx',413 '069xxx-xxx-xxxx-xxxxxxxx-xx-xxx-xxxxxxxx',414 '070xxx-xxx-xxxx-xxxxxxxx-xxxxxx-xxxxxxx',415 '071xxx-xxx-xxxx-xxxxxxxxxx',416 '072xxx-xxxx-xxxx-xxxxxxxxxxxxxxxx',417 '073xxx-xxx-xxxx-xxxxxx-xxxxxx-xxxxxxx',418 '074xxx-xxx-xxxx-xxxxxxx-xxxxxxxxxxxxx',419 '075xxx-xxx-xxxx-xxxxxxx-xxxxxxxxxxxxx-xxxxxxxxx',420 '076xxx-xxx-xxxx-xxxxxxxxxxxxx-xxxxxxx',421 '077xxx-xxx-xxxx-xxxxxxxxx-xxxxxxx-x2',422 '078xxx-xxx-xxxx-xxx',423 '079xxx-xxx-xxxx-xxxxxxxxxxxx',424 '080xxx-xxx-xxxx-xxxxxxxxx-xxxxxxxx',425 '081xxx-xxx-xxxx-xxxxxxxx-xxxxxxxxx',426 '082xxx-xxx-xxxx-xxxxxxxxx',427 '083xxx-xxx-xxxx-xxxxxxx',428 '084xxx-xxx-xxxx-xxxxxxx-xxxxxx',429 '085xxxx-xxx-xxxxxxx-xxxxx-xxxx',430 '086xxx-xxx-xxxxxxxx-xxxx-xxxxxxxxxx',431 '087xxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',432 '088xxx-xxx-xxxxxxx-xxxxxxxx',433 '089xxx-xxx-xxxxxxxx-xxxxxxx',434 '090xxx-xxx-xxxxxxxx-xxxxxxx-xxxxxx',435 '091xxx-xxxx-xxxxxxxxxx',436 '092xxx-xxx-xxxxxx-xx',437 '093xxx-xxx-xxxxxxx',438 '094xxx-xxx-xxxxxxx-xxxxx',439 '095xxx-xxx-xxxxxxxxxx',440 '096xxx-xxx-xxxxxxxxxxxxxxx',441 '098xxx-xxx-xxxxxxxxxxxxxxxxx',442 '098xxx-xxx-xxxxxxxx-xxxxxxx-xxxxxxx',443 '099xxx-xxx-xxxxxxxx-xx',444 '100xxx-xxx-xxxx-xxxxxxxxxxx-xxxxxxx',445 '101xxx-xxxx-xxxxxxxxxxxxxxxx',446 '102xxx-xxx-xxxxxxxxxxxxxxxxxx',447 '103xxx-xxx-xxxxxxxx-xxxxxxxxxxxx-xxx',448 '104xxx-xxx-xxxx-xxxxxxx',449 '105xxx-xxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',450 '106xxx-xxx-xxx-xxxx-xxxx-xxx-xxxxxxxxx',451 '107xxx-xxx-xxxxxxxxx',452 '108xxx-xxx-xxx-xxxxxxx',453 '109xxx-xxx-xxx-xxxxxxx',454 '110xxx-xxxx-xxxxx',455 '111xxx-xxx-xxx-xxxx-xxxx',456 '112xxx-xxx-xxx-xxxxxxx',457 '113xxx-xxx-xxx-xxxxxxx',458 '114xxx-xxx-xxxxxxxxxxxx-xxxxxxx',459 '115xxx-xxx-xxx-xxxx-xxxx',460 '116xxx-xxx-xxx-xxxxxxxx-xxxxxxxx',461 '117xxx-xxx-xxxxxxx',462 '118xxx-xxx-xxxxxxxx-xxxxxxx',463 '119xxx-xxx-xxxxxx',464 '120xxxx-xxx-xxxxxxxxxx',465 '121xxx-xxx-xxxxxx-xxxxxx-xxxxxxx',466 '122xxx-xxx-xxxxxx-xxxxxxx',467 '123xxx-xxx-xxxxxx-xx',468 '124xxxx-xxx-xxx-xxxx-xxxxxxx',469 '125xxx-xxx-xxxxxxxxxxx',470 '126xxx-xxx-xxxxxxxxxxx-xxxxxxx',471 '127xxx-xxx-xxxxxx-xxx-xxxxxx',472 '128xxx-xxx-xxxxxxxxxx',473 '129xxx-xxx-xxxxxxxxxx-xxx',474 '130xxx-xxx-xxxxx-xxxxxxx',475 '131xxx-xxx-xxxxxx-xxxxxxxx-xxx',476 '132xxx-xxx-xxxxx-xxxxxxxx-xxxxxx',477 '133xxx-xxx-xxxxx-xx',478 '134xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxxx',479 '135xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxx',480 '136xxx-xxx-xxxxxxxxxxxxxxx',481 '137xxx-xxx-xxx',482 '138xxx-xxx-xxxxxxx-xxxxxxx',483 '139xxx-xxx-xxxxxxx-xxx-xxxxxxx',484 '140xxx-xxx-xxxxxxxxx-xxxxxx-xxxxxxx',485 '141xxx-xxx-xxxxxxxxxx-xxxx-xxxxxxx',486 '142xxx-xxx-xx-xxxxxxxxxx-xxxxx',487 '143xxx-xxx-xxxxxxxxxxxxxx-xxxxxxx',488 '144xxx-xxx-xxxxxxxxxxxxxxxxx',489 '145xxx-xxx-xxxxxxxx-xxxxxxx',490 '146xxx-xxx-xxxxxxxxxxxxx-xxxxxxx',491 '147xxx-xxx-xxxxxxx-xxxxxxx',492 '148xxx-xxx-xxxxxx-xxxxxxx',493 '149xxx-xxx-xxxxx-xxxxx',494 '150xxx-xxx-xxxxx-xxxx',495 '151xxx-xxx-xxxxxxxxxxxxxxxxx',496 '152xxx-xxx-xxxxxxxxxxxxxxxxxxx',497 '153xxx-xxx-xxxxxxxxx-xxxxx-xxx',498 '154xxx-xxx-xxxxxxxx-xxxxx-xxxx-xxxx',499 '155xxx-xxx-xxxxxxxx-xxxxxxxxxxxx-xxxx',500 '156xxx-xxx-xxxxxxxx-xx-xxx-xxxxxxxx',501 '157xxx-xxx-xxxxxxxx-xxxxxx-xxxxxxx',502 '158xxx-xxx-xxxxxxxxxx',503 '159xxx-xxx-xxxx-xxxxxx',504 '160xxx-xxx-xxxxxxxxxx',505 '161xxx-xxx-xxxxxxxxxxxxx',506 '162xxx-xxx-xxxxxxxxxxxxxxxx',507 '163xxx-xxx-xxxxx-xxxxxx-xxxxxxx',508 '164xxx-xxx-xxxxxxx-xxxxxxxxxxxxx',509 '165xxx-xxx-xxxxxxxxxxxxxx-xxxxxxx',510 '166xxx-xxx-xxxxxxxxx-xxxxxxx-x2',511 '167xxx-xxx-xxx',512 '168xxx-xxx-xxxxxxxxxxxx',513 '169xxx-xxx-xxxxxxxxx-xxxxxxxx',514 '170xxx-xxx-xxxxxxxxx-xxx-xxxxxxx',515 '171xxx-xxx-xxxxxxxxx',516 '172xxx-xxxx-xxxxxxxxx',517 '173xxx-xxx',518 '174xxx-xxxxxx-xxxxxxx',519 '175xxx-xxxxxx-xxxxxx-xxxx',520 '176xxx-xxxxxx-xxxxx',521 '177xxx-xxxxx-xxxxxxxx',522 '178xxx-xxxxxx',523 '179xxx-xxxxxxx-xxxx',524 '180xxx-xxxxxxx-xxxx-xxxx',525 '181xxx-xxxxxxx-xxxx-xxxxxxx',526 '182xxx-xxxxxxx-xxxx-xxxxxxxxxxxxxxx',527 '183xxx-xxxxxxxx-xxxx-xxxxx',528 '184xxx-xxxxxxx-xxxx-xxxxxxx',529 '185xxx-xxxxxxx-xxxx-xxxxxxxx-xxxxxxx',530 '186xxx-xxxxxxx-xxxx-xxx',531 '187xxx-xxxxxxx-xxxx-xxxxxxx-xxx-xxxxxxx',532 '188xxx-xxxxxxx-xxxx-xxxxxxxxxxxxxx-xxxxxxx',533 '189xxx-xxxxxxxx-xxxx-xxxxxxxxxxxxxxxxx',534 '190xxx-xxxxxxx-xxxx-xxxxx-xxxxxx-xxxxxxx',535 '191xxx-xxxxxxx-xxxxxxxxxx',536 '192xxx-xxxxxxx-xxxxxxx',537 '193xxx-xxxxxxx-xxxxxxxxxxxxxxx',538 '194xxx-xxxxxxx-xxxxx',539 '195xxx-xxxxxxx-xxxxxxx',540 '196xxx-xxxxxxx-xxxxxxxx-xxxxxxx',541 '197xxx-xxxxxxx-xxx',542 '198xxx-xxxxxxx-xxxxxxx-xxx-xxxxxxx',543 '199xxx-xxxxxxx-xxxxxxxxxxxxxx-xxxxxxx',544 '200xxx-xxxxxxxx-xxxxxxxxxxxxxxxxx',545 '201xxx-xxxxxxx-xxxxx-xxxxxx-xxxxxxx',546 '202xxx-xxx',547 '203xxx-xxx-xxxxxx',548 '204xxxxxxxxx-xxx',549 '205xxxxxxxxxxx-xxx',550 '206xxxxxxxxx-xxxxxxx',551 '207xxxx-xxxxxx-xxxxxxxxxxx-xxxxx1',552 '208xxxx-xxxxxxxx-xxxxxxxx-xxxxx1',553 '209xxxx-xxxxxxx-xxxxxxx-xxxxx1',554 '209xxxx-xxxxxxx-xxxxxxx-xxxxx2',555 '210xxxx-xxxx-xxxxxxx-xxxxx1',556 '211xxxx-xxxxx-xxxxxxxx1-xxxxx1',557 '212xxxx-xxxx-xxxxxxxx2-xxxxx1',558 '213xxxx-xxxx-xxxxxxx1-xxxxx1',559 '214xxxx-xxxx-xxxxxxx2-xxxxx1',560 '215xxxxxxxxx-xxxxxx',561 '216xxxxxxxxx-xxxxxxx',562 '217xxxxxxxxx-xxxx',563];564565{566 'yyyyyyyyy': {567 local Func3(z, n) = utils.Func3('yyyyyyyyy', z, n),568569 global: {570 [n]: {571 members: [572 Func3(z, '%s-gggg-%s-%s' % [n, z, suffix]),573 for z in ['ooooooo-a', 'ooooooo-b', 'ooooooo-c',574 'ooooooo-a', 'ooooooo-b', 'ooooooo-c']575 for suffix in ['a', 'b', 'c']576 ],577 }578 for n in long_list579 },580 },581}582583```584</details>585586| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |587|:---|---:|---:|---:|---:|588| `Rust` | 14.6 ± 0.6 | 13.5 | 17.9 | 1.00 |589| `Go` | 7663.9 ± 114.5 | 7518.9 | 7912.3 | 524.74 ± 24.02 |590| `Scala` | 414.1 ± 5.4 | 406.8 | 429.4 | 28.35 ± 1.28 |591| `C++` | 26376.7 ± 354.2 | 25755.3 | 26908.5 | 1806.00 ± 81.81 |592593### Realistic 2594595<details>596<summary>Source</summary>597598```jsonnet599local rfc3339(timestamp) = '1970-01-01T00:00:00Z';600601local name1(a, b, c) =602 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%sBBBBBBB%sCCCCCCCCCCC%s'603 % [a, b, c];604605local name2(x) =606 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%s' % x;607608local T1 = 'PPPPPPPPPPPPPPPPPPPPPPP';609local T2 = 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ';610611local LOCATIONS = [612 'europe-west1-b',613 'europe-west1-c',614 'europe-west1-d',615 'europe-west2-a',616 'europe-west2-b',617 'europe-west2-c',618 'europe-west3-a',619 'europe-west3-b',620 'europe-west3-c',621 'europe-west4-a',622 'europe-west4-b',623 'europe-west4-c',624 'us-central1-a',625 'us-central1-b',626 'us-central1-c',627 'us-central1-f',628 'us-east1-b',629 'us-east1-c',630 'us-east1-d',631 'us-east4-a',632 'us-east4-b',633 'us-east4-c',634 'us-west1-a',635 'us-west1-b',636 'us-west1-c',637];638639640// The return value is a function to allow it to be parameterized.641function(642 timestamp=0,643 x='xxxxxxxxxxxxxxxxxxx',644 prefix='prefix',645 num1=50,646 count=25,647 offset=0,648)649 local rfc_timestamp = rfc3339(timestamp);650651 local func1(i) =652 local location = LOCATIONS[i % std.length(LOCATIONS)];653 [654 local name = '%s-%000d-%000d' % [prefix, i, j];655 {656 field_zz1: rfc_timestamp,657 fie_z2: {658 field_z3: name1(x, location, name),659 field_zzzzzzzzzz4: name2(x),660 field_zzz5: [name],661 field_z6: T1,662 field_z7: location,663 fi_8: '???',664 fiel_z9: '99',665 },666 }667 for j in std.range(0, num1 - 1)668 ];669670 local func2(i) =671 local location = LOCATIONS[i % std.length(LOCATIONS)];672 local all = [673 name1(x, location, '%s-%000d-%000d' % [prefix, i, j])674 for j in std.range(0, num1 - 1)675 ];676 [677 {678 field_yy1: rfc_timestamp,679 field_yyyyy2: 'EEEE',680 field_yyyyy3: {681 field_y4: T2,682 field_yyyyyyy5: p,683 field_yyyyyyy6: q,684 },685 }686 for p in all687 for q in all688 if p != q689 ];690691692 {693 field_x1: '-----',694 field_xxxxxxxxxxxxxxxx2: std.join([], [695 func1(offset * count + i)696 for i in std.range(0, count - 1)697 ]),698 field_xxxxxxxxxxxxxxxxxxxxxx3: std.join([], [699 func2(offset * count + i)700 for i in std.range(0, count - 1)701 ]),702 }703704705```706</details>707708| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |709|:---|---:|---:|---:|---:|710| `Rust` | 295.6 ± 8.9 | 285.1 | 319.9 | 1.00 |711| `Go` | 7540.7 ± 107.5 | 7357.3 | 7792.5 | 25.51 ± 0.85 |712| `Scala` | 781.0 ± 27.4 | 745.3 | 854.7 | 2.64 ± 0.12 |713| `C++` | 30144.1 ± 574.5 | 28895.0 | 30967.3 | 101.99 ± 3.62 |714715## Benchmarks from C++ jsonnet (/benchmarks)716717### Tail call718719<details>720<summary>Source</summary>721722```jsonnet723/*724Copyright 2015 Google Inc. All rights reserved.725726Licensed under the Apache License, Version 2.0 (the "License");727you may not use this file except in compliance with the License.728You may obtain a copy of the License at729730 http://www.apache.org/licenses/LICENSE-2.0731732Unless required by applicable law or agreed to in writing, software733distributed under the License is distributed on an "AS IS" BASIS,734WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.735See the License for the specific language governing permissions and736limitations under the License.737*/738739local sum(x) =740 if x == 0 then741 0742 else743 x + sum(x - 1);744sum(300)745746```747</details>748749| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |750|:---|---:|---:|---:|---:|751| `Rust` | 2.2 ± 0.1 | 1.9 | 3.6 | 1.00 |752| `Go` | 6.7 ± 0.6 | 6.0 | 17.0 | 3.10 ± 0.32 |753| `Scala` | 306.5 ± 2.1 | 302.8 | 311.8 | 141.78 ± 7.81 |754| `C++` | 34.7 ± 2.2 | 32.6 | 52.1 | 16.04 ± 1.35 |755756### Inheritance recursion757758<details>759<summary>Source</summary>760761```jsonnet762/*763Copyright 2015 Google Inc. All rights reserved.764765Licensed under the Apache License, Version 2.0 (the "License");766you may not use this file except in compliance with the License.767You may obtain a copy of the License at768769 http://www.apache.org/licenses/LICENSE-2.0770771Unless required by applicable law or agreed to in writing, software772distributed under the License is distributed on an "AS IS" BASIS,773WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.774See the License for the specific language governing permissions and775limitations under the License.776*/777778local Fib = {779 n: 1,780 local outer = self,781 r: if self.n <= 1 then 1 else (Fib { n: outer.n - 1 }).r + (Fib { n: outer.n - 2 }).r,782};783784(Fib { n: 25 }).r785786```787</details>788789| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |790|:---|---:|---:|---:|---:|791| `Rust` | 452.8 ± 20.3 | 425.2 | 494.6 | 1.00 |792| `Go` | 1076.4 ± 16.2 | 1049.9 | 1111.1 | 2.38 ± 0.11 |793| `Scala` | 475.5 ± 8.7 | 462.2 | 494.4 | 1.05 ± 0.05 |794| `C++` | 3029.7 ± 121.1 | 2787.2 | 3214.5 | 6.69 ± 0.40 |795796### Simple recursive call797798<details>799<summary>Source</summary>800801```jsonnet802/*803Copyright 2015 Google Inc. All rights reserved.804805Licensed under the Apache License, Version 2.0 (the "License");806you may not use this file except in compliance with the License.807You may obtain a copy of the License at808809 http://www.apache.org/licenses/LICENSE-2.0810811Unless required by applicable law or agreed to in writing, software812distributed under the License is distributed on an "AS IS" BASIS,813WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.814See the License for the specific language governing permissions and815limitations under the License.816*/817818local fibonacci(n) =819 if n <= 1 then820 1821 else822 fibonacci(n - 1) + fibonacci(n - 2);823824fibonacci(25)825826```827</details>828829| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |830|:---|---:|---:|---:|---:|831| `Rust` | 109.2 ± 2.4 | 104.8 | 114.3 | 1.00 |832| `Go` | 429.0 ± 8.2 | 419.4 | 454.3 | 3.93 ± 0.12 |833| `Scala` | 338.7 ± 3.2 | 334.6 | 345.6 | 3.10 ± 0.07 |834| `C++` | 210.0 ± 8.0 | 195.5 | 227.5 | 1.92 ± 0.08 |835836### Foldl string concat837838<details>839<summary>Source</summary>840841```jsonnet842std.foldl(function(e, res) e + res, std.makeArray(20000, function(i) 'aaaaa'), '')843844```845</details>846847| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |848|:---|---:|---:|---:|---:|849| `Rust` | 12.5 ± 0.6 | 11.4 | 17.3 | 1.00 |850| `Go` | 64.8 ± 3.1 | 60.8 | 78.8 | 5.16 ± 0.36 |851| `Scala` | 630.6 ± 15.6 | 606.3 | 659.8 | 50.25 ± 2.83 |852| `C++` | 1073.3 ± 18.2 | 1041.0 | 1107.6 | 85.53 ± 4.56 |853854### Array sorts855856> Note: No results for Scala, std.reverse is not implemented857858<details>859<summary>Source</summary>860861```jsonnet862// A benchmark for builtin sort863864local reverse = std.reverse;865local sort = std.sort;866867true868&& std.assertEqual(std.range(1, 500), sort(std.range(1, 500)))869&& std.assertEqual(std.range(1, 1000), sort(std.range(1, 1000)))870&& std.assertEqual(reverse(std.range(1, 1000)), sort(std.range(1, 1000), keyF=function(x) -x))871&& std.assertEqual(std.range(1, 1000), sort(reverse(std.range(1, 1000))))872&& std.assertEqual(std.makeArray(2000, function(i) std.floor((i + 2) / 2)), sort(std.range(1, 1000) + reverse(std.range(1, 1000))))873874```875</details>876877| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |878|:---|---:|---:|---:|---:|879| `Rust` | 4.2 ± 0.1 | 3.9 | 4.9 | 1.00 |880| `Go` | 14.8 ± 0.5 | 13.7 | 17.8 | 3.51 ± 0.17 |881| `C++` | 3964.0 ± 187.1 | 3700.2 | 4225.1 | 939.25 ± 55.45 |882883### Lazy array884885<details>886<summary>Source</summary>887888```jsonnet889local f2(f) = function(x) f(f(x));890local id(x) = x;891892local slowId = std.makeArray(20, function(i) if i == 0 then id else f2(slowId[i - 1]));893894slowId[15](42)895896```897</details>898899| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |900|:---|---:|---:|---:|---:|901| `Rust` | 58.8 ± 2.0 | 55.6 | 64.2 | 1.00 |902| `Go` | 661.6 ± 26.6 | 629.6 | 730.1 | 11.25 ± 0.59 |903| `Scala` | 348.8 ± 6.6 | 339.7 | 365.3 | 5.93 ± 0.23 |904| `C++` | 206.4 ± 3.3 | 202.5 | 215.2 | 3.51 ± 0.13 |905906### Inheritance function recursion907908<details>909<summary>Source</summary>910911```jsonnet912local fibnext = {913 a: super.a + super.b,914 b: super.a,915};916local fib(n) =917 if n == 0 then918 { a: 1, b: 1 }919 else920 fib(n - 1) + fibnext;921922fib(25)923924```925</details>926927| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |928|:---|---:|---:|---:|---:|929| `Rust` | 1.9 ± 0.1 | 1.6 | 3.3 | 1.00 |930| `Go` | 3.0 ± 0.2 | 2.7 | 5.1 | 1.58 ± 0.15 |931| `Scala` | 310.0 ± 9.5 | 299.9 | 341.1 | 161.51 ± 9.88 |932| `C++` | 1505.6 ± 74.0 | 1363.5 | 1640.8 | 784.26 ± 56.71 |933934### String strips935936<details>937<summary>Source</summary>938939```jsonnet940// This string must be longer than max stack frames941local veryLongString = std.join('', std.repeat(['e'], 510));942943std.assertEqual(std.stripChars(veryLongString + 'ok' + veryLongString, 'e'), 'ok') &&944std.assertEqual(std.lstripChars(veryLongString + 'ok', 'e'), 'ok') &&945std.assertEqual(std.rstripChars('ok' + veryLongString, 'e'), 'ok') &&946947true948949```950</details>951952| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |953|:---|---:|---:|---:|---:|954| `Rust` | 9.4 ± 0.3 | 8.7 | 10.4 | 1.00 |955| `Go` | 15.0 ± 0.5 | 13.9 | 17.6 | 1.60 ± 0.08 |956| `Scala` | 340.6 ± 5.4 | 333.3 | 359.9 | 36.39 ± 1.36 |957| `C++` | 37161.7 ± 525.9 | 36471.3 | 38275.4 | 3970.49 ± 145.97 |958959### Big object960961<details>962<summary>Source</summary>963964```jsonnet965// Generator source966local n = 2000;967968local objLocal(name, body) = 'local ' + name + ' = ' + body + ',';969local objField(name, body) = name + ': ' + body + ',';970971local allLocals =972 std.makeArray(n, function(i) objLocal('l' + i, '1'));973974local allFields =975 std.makeArray(n, function(i) objField('f' + i, '2'));976977local indent = ' ';978local indentAndSeparate(s) = indent + s + '\n';979980local objContents = std.map(indentAndSeparate, allLocals + allFields);981982local objectBody = std.join('', objContents);983'{\n' + objectBody + '}\n'984985```986</details>987988| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |989|:---|---:|---:|---:|---:|990| `Rust` | 2.5 ± 0.1 | 2.3 | 3.3 | 1.00 |991| `Go` | 5.2 ± 0.3 | 4.6 | 7.0 | 2.07 ± 0.15 |992| `Scala` | 302.6 ± 6.4 | 290.3 | 312.9 | 120.34 ± 6.71 |993| `C++` | 29.4 ± 1.4 | 27.7 | 38.5 | 11.71 ± 0.82 |994995## Benchmarks from Go jsonnet (builtins)996997### std.base64998999<details>1000<summary>Source</summary>10011002```jsonnet1003{1004 foo: [1005 std.base64("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.") for i in std.range(0,100)1006 ],1007}1008```1009</details>10101011| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1012|:---|---:|---:|---:|---:|1013| `Rust` | 3.4 ± 0.1 | 3.1 | 4.9 | 1.00 |1014| `Go` | 21.6 ± 0.8 | 19.7 | 27.1 | 6.32 ± 0.34 |1015| `Scala` | 355.0 ± 6.0 | 340.7 | 367.4 | 103.77 ± 4.62 |1016| `C++` | 16359.4 ± 663.5 | 15526.0 | 17805.8 | 4782.25 ± 276.36 |10171018### std.base64Decode10191020<details>1021<summary>Source</summary>10221023```jsonnet1024{1025 foo: [1026 std.base64Decode("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEuIFNlZCB0dXJwaXMgdGluY2lkdW50IGlkIGFsaXF1ZXQgcmlzdXMuIEVnZXQgbWF1cmlzIHBoYXJldHJhIGV0IHVsdHJpY2VzIG5lcXVlIG9ybmFyZSBhZW5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dCB0ZW1wb3IgY29tbW9kby4gVmVsaXQgZGlnbmlzc2ltIHNvZGFsZXMgdXQgZXUgc2VtIGludGVnZXIuIERpY3R1bSBzaXQgYW1ldCBqdXN0byBkb25lYy4gU2NlbGVyaXNxdWUgbWF1cmlzIHBlbGxlbnRlc3F1ZSBwdWx2aW5hciBwZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzLiBTY2VsZXJpc3F1ZSBtYXVyaXMgcGVsbGVudGVzcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4gU2NlbGVyaXNxdWUgbWF1cmlzIHBlbGxlbnRlc3F1ZSBwdWx2aW5hciBwZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzLiBTY2VsZXJpc3F1ZSBtYXVyaXMgcGVsbGVudGVzcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4=") for i in std.range(0,100)1027 ],1028}1029```1030</details>10311032| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1033|:---|---:|---:|---:|---:|1034| `Rust` | 3.4 ± 0.2 | 3.1 | 5.3 | 1.00 |1035| `Go` | 21.0 ± 1.5 | 19.6 | 32.2 | 6.24 ± 0.52 |1036| `Scala` | 358.3 ± 7.1 | 349.0 | 379.9 | 106.23 ± 5.27 |1037| `C++` | 10921.3 ± 240.4 | 10653.9 | 11346.7 | 3237.97 ± 163.58 |10381039### std.base64DecodeBytes10401041<details>1042<summary>Source</summary>10431044```jsonnet1045{1046 foo: [1047 std.base64DecodeBytes("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEuIFNlZCB0dXJwaXMgdGluY2lkdW50IGlkIGFsaXF1ZXQgcmlzdXMuIEVnZXQgbWF1cmlzIHBoYXJldHJhIGV0IHVsdHJpY2VzIG5lcXVlIG9ybmFyZSBhZW5lYW4gZXVpc21vZC4gRGlhbSBxdWlzIGVuaW0gbG9ib3J0aXMgc2NlbGVyaXNxdWUgZmVybWVudHVtLiBWYXJpdXMgZHVpcyBhdCBjb25zZWN0ZXR1ciBsb3JlbSBkb25lYyBtYXNzYSBzYXBpZW4uIERpYW0gc2l0IGFtZXQgbmlzbCBzdXNjaXBpdCBhZGlwaXNjaW5nIGJpYmVuZHVtIGVzdCB1bHRyaWNpZXMgaW50ZWdlci4gTGVjdHVzIHVybmEgZHVpcyBjb252YWxsaXMgY29udmFsbGlzIHRlbGx1cy4gTmliaCBpcHN1bSBjb25zZXF1YXQgbmlzbCB2ZWwgcHJldGl1bSBsZWN0dXMgcXVhbSBpZCBsZW8uIEZldWdpYXQgaW4gYW50ZSBtZXR1cyBkaWN0dW0gYXQgdGVtcG9yIGNvbW1vZG8uIFZlbGl0IGRpZ25pc3NpbSBzb2RhbGVzIHV0IGV1IHNlbSBpbnRlZ2VyLiBEaWN0dW0gc2l0IGFtZXQganVzdG8gZG9uZWMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0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zcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4=") for i in std.range(0,100)1048 ],1049}1050```1051</details>10521053| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1054|:---|---:|---:|---:|---:|1055| `Rust` | 45.7 ± 1.4 | 43.6 | 52.1 | 1.00 |1056| `Go` | 303.6 ± 8.4 | 292.1 | 324.7 | 6.64 ± 0.27 |1057| `Scala` | 406.3 ± 8.3 | 397.0 | 424.8 | 8.88 ± 0.32 |1058| `C++` | 10058.3 ± 337.9 | 9738.8 | 10641.5 | 219.86 ± 9.92 |10591060### std.base64 (byte array)10611062<details>1063<summary>Source</summary>10641065```jsonnet1066{1067 foo: [1068 std.base64([76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115]),for i in std.range(0,100)1069 ],1070}1071```1072</details>10731074| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1075|:---|---:|---:|---:|---:|1076| `Rust` | 37.0 ± 1.8 | 33.7 | 42.5 | 1.00 |1077| `Go` | 195.8 ± 11.5 | 180.9 | 219.5 | 5.28 ± 0.41 |1078| `Scala` | 419.2 ± 13.0 | 396.5 | 454.6 | 11.32 ± 0.66 |1079| `C++` | 15605.3 ± 310.2 | 15173.1 | 16065.6 | 421.22 ± 22.47 |10801081### std.foldl10821083<details>1084<summary>Source</summary>10851086```jsonnet1087local input = std.makeArray(10000, function(i) 'xxxxx');10881089std.foldl(function(acc, value) acc + value, input, '')10901091```1092</details>10931094| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1095|:---|---:|---:|---:|---:|1096| `Rust` | 7.7 ± 0.7 | 6.8 | 18.5 | 1.00 |1097| `Go` | 32.6 ± 1.1 | 30.6 | 37.8 | 4.26 ± 0.41 |1098| `Scala` | 461.7 ± 8.5 | 445.0 | 484.5 | 60.35 ± 5.54 |1099| `C++` | 320.3 ± 6.0 | 308.6 | 335.0 | 41.87 ± 3.85 |11001101### std.manifestJsonEx11021103<details>1104<summary>Source</summary>11051106```jsonnet1107{1108 bar: {1109 prometheusOperator+: {1110 service+: {1111 spec+: {1112 ports: [1113 {1114 name: 'https',1115 port: 8443,1116 targetPort: 'https',1117 },1118 ],1119 },1120 },1121 serviceMonitor+: {1122 spec+: {1123 endpoints: [1124 {1125 port: 'https',1126 scheme: 'https',1127 honorLabels: true,1128 bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',1129 tlsConfig: {1130 insecureSkipVerify: true,1131 },1132 },1133 ]1134 },1135 },1136 clusterRole+: {1137 rules+: [1138 {1139 apiGroups: ['authentication.k8s.io'],1140 resources: ['tokenreviews'],1141 verbs: ['create'],1142 },1143 {1144 apiGroups: ['authorization.k8s.io'],1145 resources: ['subjectaccessreviews'],1146 verbs: ['create'],1147 },1148 ],1149 },1150 }1151 },1152 foo: std.manifestJsonEx(self.bar, " ")1153}1154```1155</details>11561157| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1158|:---|---:|---:|---:|---:|1159| `Rust` | 1.9 ± 0.1 | 1.7 | 3.0 | 1.00 |1160| `Go` | 4.2 ± 0.3 | 3.6 | 8.0 | 2.14 ± 0.18 |1161| `Scala` | 338.9 ± 3.4 | 334.9 | 348.8 | 174.49 ± 8.63 |1162| `C++` | 106.6 ± 3.2 | 102.8 | 113.2 | 54.90 ± 3.12 |11631164### std.manifestTomlEx11651166> Note: No results for Scala, std.manifestTomlEx is not implemented11671168<details>1169<summary>Source</summary>11701171```jsonnet1172{1173 bar: {1174 prometheusOperator+: {1175 service+: {1176 spec+: {1177 ports: [1178 {1179 name: 'https',1180 port: 8443,1181 targetPort: 'https',1182 },1183 ],1184 },1185 },1186 serviceMonitor+: {1187 spec+: {1188 endpoints: [1189 {1190 port: 'https',1191 scheme: 'https',1192 honorLabels: true,1193 bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',1194 tlsConfig: {1195 insecureSkipVerify: true,1196 },1197 },1198 ],1199 },1200 },1201 clusterRole+: {1202 rules+: [1203 {1204 apiGroups: ['authentication.k8s.io'],1205 resources: ['tokenreviews'],1206 verbs: ['create'],1207 },1208 {1209 apiGroups: ['authorization.k8s.io'],1210 resources: ['subjectaccessreviews'],1211 verbs: ['create'],1212 },1213 ],1214 },1215 },1216 },1217 nothing: std.manifestTomlEx(self.bar, ' '),1218}12191220```1221</details>12221223| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1224|:---|---:|---:|---:|---:|1225| `Rust` | 1.9 ± 0.1 | 1.8 | 2.7 | 1.00 |1226| `Go` | 4.2 ± 0.3 | 3.7 | 8.0 | 2.17 ± 0.19 |1227| `C++` | 1131.6 ± 28.1 | 1089.2 | 1198.7 | 584.01 ± 30.62 |12281229### std.parseInt12301231<details>1232<summary>Source</summary>12331234```jsonnet1235{1236 foo: [1237 std.parseInt("-123949595") for i in std.range(0,100)1238 ],1239}1240```1241</details>12421243| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1244|:---|---:|---:|---:|---:|1245| `Rust` | 2.0 ± 0.1 | 1.7 | 3.2 | 1.00 |1246| `Go` | 3.7 ± 0.4 | 3.1 | 9.0 | 1.85 ± 0.21 |1247| `Scala` | 332.3 ± 7.2 | 326.1 | 359.7 | 168.32 ± 10.37 |1248| `C++` | 110.2 ± 1.9 | 106.9 | 115.1 | 55.82 ± 3.36 |12491250### std.reverse12511252> Note: No results for Scala, std.reverse is not implemented12531254<details>1255<summary>Source</summary>12561257```jsonnet1258{1259 foo: [1260 std.reverse(std.range(0, 5000)) for i in std.range(0,100)1261 ],1262}1263```1264</details>12651266| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1267|:---|---:|---:|---:|---:|1268| `Rust` | 59.7 ± 1.9 | 56.3 | 64.7 | 1.00 |1269| `Go` | 363.6 ± 9.0 | 352.8 | 385.1 | 6.09 ± 0.25 |1270| `C++` | 865.9 ± 16.1 | 839.9 | 902.0 | 14.51 ± 0.54 |12711272### std.substr12731274<details>1275<summary>Source</summary>12761277```jsonnet1278{1279 foo: [1280 std.substr("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. ", i, 800-i) for i in std.range(0,100)1281 ],1282}1283```1284</details>12851286| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1287|:---|---:|---:|---:|---:|1288| `Rust` | 2.6 ± 0.1 | 2.3 | 3.5 | 1.00 |1289| `Go` | 8.9 ± 0.6 | 8.0 | 15.3 | 3.46 ± 0.29 |1290| `Scala` | 346.6 ± 9.4 | 337.8 | 375.9 | 134.32 ± 7.51 |1291| `C++` | 31.4 ± 1.0 | 29.7 | 36.4 | 12.17 ± 0.72 |12921293### Comparsion for array12941295> Note: No results for Scala, array comparsion is not implemented12961297<details>1298<summary>Source</summary>12991300```jsonnet1301local long_array = std.range(1, 1000000);1302long_array + [1] < long_array + [2]13031304```1305</details>13061307| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1308|:---|---:|---:|---:|---:|1309| `Rust` | 26.0 ± 0.6 | 25.4 | 30.2 | 1.00 |1310| `Go` | 121.5 ± 6.5 | 116.2 | 141.0 | 4.68 ± 0.28 |1311| `C++` | 147098.5 ± 3334.1 | 135178.4 | 150470.0 | 5663.91 ± 187.03 |13121313### Comparsion for primitives13141315> Note: No results for C++, can't run: uses up to 192GB of RAM13161317<details>1318<summary>Source</summary>13191320```jsonnet1321([ i < j for i in std.range(1, 1000) for j in std.range(1, 1000)])13221323```1324</details>13251326| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1327|:---|---:|---:|---:|---:|1328| `Rust` | 284.7 ± 10.4 | 267.1 | 315.4 | 1.00 |1329| `Go` | 2009.5 ± 46.0 | 1931.3 | 2108.9 | 7.06 ± 0.31 |1330| `Scala` | 550.0 ± 14.8 | 526.3 | 575.4 | 1.93 ± 0.09 |1# Benchmarks23There are multiple implementations of jsonnet implemented in different languages: Rust (this repo), [Go](https://github.com/google/go-jsonnet/), [Scala](https://github.com/databricks/sjsonnet), [C++](https://github.com/google/jsonnet), [Haskell](https://github.com/moleike/haskell-jsonnet).45For simplicity, I will call these implementations by the language of their implementation.67Unfortunately, I haven't managed to measure performance of Haskell implementation, because I wasn't able to build it, and there is no binaries published anywhere, so this implementation is omitted from the following benchmarks89<details>10<summary>Tested versions</summary>1112Go: Jsonnet commandline interpreter (Go implementation) v0.20.01314```15Jsonnet commandline interpreter (Go implementation) v0.20.01617jsonnet {<option>} <filename>1819Available options:20 -h / --help This message21 -e / --exec Treat filename as code22 -J / --jpath <dir> Specify an additional library search dir23 (right-most wins)24 -o / --output-file <file> Write to the output file rather than stdout25 -m / --multi <dir> Write multiple files to the directory, list files26 on stdout27 -c / --create-output-dirs Automatically creates all parent directories for28 files29 -y / --yaml-stream Write output as a YAML stream of JSON documents30 -S / --string Expect a string, manifest as plain text31 -s / --max-stack <n> Number of allowed stack frames32 -t / --max-trace <n> Max length of stack trace before cropping33 --version Print version3435Available options for specifying values of 'external' variables:36 Provide the value as a string:37 -V / --ext-str <var>[=<val>] If <val> is omitted, get from environment38 var <var>39 --ext-str-file <var>=<file> Read the string from the file40 Provide a value as Jsonnet code:41 --ext-code <var>[=<code>] If <code> is omitted, get from environment42 var <var>43 --ext-code-file <var>=<file> Read the code from the file4445Available options for specifying values of 'top-level arguments':46 Provide the value as a string:47 -A / --tla-str <var>[=<val>] If <val> is omitted, get from environment48 var <var>49 --tla-str-file <var>=<file> Read the string from the file50 Provide a value as Jsonnet code:51 --tla-code <var>[=<code>] If <code> is omitted, get from environment52 var <var>53 --tla-code-file <var>=<file> Read the code from the file5455Environment variables:56 JSONNET_PATH is a colon (semicolon on Windows) separated list of directories57 added in reverse order before the paths specified by --jpath (i.e. left-most58 wins). E.g. these are equivalent:59 JSONNET_PATH=a:b jsonnet -J c -J d60 JSONNET_PATH=d:c:a:b jsonnet61 jsonnet -J b -J a -J c -J d6263In all cases:64 <filename> can be - (stdin)65 Multichar options are expanded e.g. -abc becomes -a -b -c.66 The -- option suppresses option processing for subsequent arguments.67 Note that since filenames and jsonnet programs can begin with -, it is68 advised to use -- if the argument is unknown, e.g. jsonnet -- "$FILENAME".69```7071C++: Jsonnet commandline interpreter v0.20.07273```74Jsonnet commandline interpreter v0.20.07576jsonnet {<option>} <filename>7778Available options:79 -h / --help This message80 -e / --exec Treat filename as code81 -J / --jpath <dir> Specify an additional library search dir (right-most wins)82 -o / --output-file <file> Write to the output file rather than stdout83 -m / --multi <dir> Write multiple files to the directory, list files on stdout84 -y / --yaml-stream Write output as a YAML stream of JSON documents85 -S / --string Expect a string, manifest as plain text86 -s / --max-stack <n> Number of allowed stack frames87 -t / --max-trace <n> Max length of stack trace before cropping88 --gc-min-objects <n> Do not run garbage collector until this many89 --gc-growth-trigger <n> Run garbage collector after this amount of object growth90 --version Print version91Available options for specifying values of 'external' variables:92Provide the value as a string:93 -V / --ext-str <var>[=<val>] If <val> is omitted, get from environment var <var>94 --ext-str-file <var>=<file> Read the string from the file95Provide a value as Jsonnet code:96 --ext-code <var>[=<code>] If <code> is omitted, get from environment var <var>97 --ext-code-file <var>=<file> Read the code from the file98Available options for specifying values of 'top-level arguments':99Provide the value as a string:100 -A / --tla-str <var>[=<val>] If <val> is omitted, get from environment var <var>101 --tla-str-file <var>=<file> Read the string from the file102Provide a value as Jsonnet code:103 --tla-code <var>[=<code>] If <code> is omitted, get from environment var <var>104 --tla-code-file <var>=<file> Read the code from the file105Environment variables:106JSONNET_PATH is a colon (semicolon on Windows) separated list of directories added107in reverse order before the paths specified by --jpath (i.e. left-most wins)108E.g. JSONNET_PATH=a:b jsonnet -J c -J d is equivalent to:109JSONNET_PATH=d:c:a:b jsonnet110jsonnet -J b -J a -J c -J d111112In all cases:113<filename> can be - (stdin)114Multichar options are expanded e.g. -abc becomes -a -b -c.115The -- option suppresses option processing for subsequent arguments.116Note that since filenames and jsonnet programs can begin with -, it is advised to117use -- if the argument is unknown, e.g. jsonnet -- "$FILENAME".118```119120Scala:121122```123Missing argument: file <str>124Expected Signature: Sjsonnet 0.4.10125usage: sjsonnet [sjsonnet-options] script-file126 -i --interactive Run Mill in interactive mode, suitable for opening REPLs and127 taking user input128 -J --jpath <str> Specify an additional library search dir (right-most wins)129 -o --output-file <str> Write to the output file rather than stdout130 -m --multi <str> Write multiple files to the directory, list files on stdout131 -c --create-output-dirs Automatically creates all parent directories for files132 -y --yaml-stream Write output as a YAML stream of JSON documents133 -S --string Expect a string, manifest as plain text134 -V --ext-str <str> <var>[=<val>] Provide 'external' variable as string. 'If135 <val> is omitted, get from environment var <var>136 --ext-str-file <str> <var>=<file> Provide 'external' variable as string from the137 file138 -V --ext-code <str> <var>[=<code>] Provide 'external' variable as Jsonnet code.139 If <code> is omitted, get from environment var <var>140 --ext-code-file <str> <var>=<file> Provide 'external' variable as Jsonnet code141 from the file142 -A --tla-str <str> <var>[=<val>] Provide top-level arguments as string. 'If143 <val> is omitted, get from environment var <var>144 --tla-str-file <str> <var>=<file> Provide top-level arguments variable as string145 from the file146 -V --tla-code <str> <var>[=<val>] Provide top-level arguments as Jsonnet code.147 'If <val> is omitted, get from environment var <var>148 --tla-code-file <str> <var>=<file> Provide top-level arguments variable as Jsonnet149 code from the file150 -n --indent <int> How much to indent your output JSON151 -p --preserve-order Preserves order of keys in the resulting JSON152 --strict Enforce some additional syntax limitations153 --yaml-out Write output as a YAML document154 file <str> The jsonnet file you wish to evaluate155 --yaml-debug Generate source line comments in the output YAML doc to make156 it easier to figure out where values come from.157 --no-static-errors Turn static errors into warnings158 --fatal-warnings Fail if any warnings were emitted159 -e --exec Evaluate the given string as Jsonnet rather than treating it160 as a file name161 --no-duplicate-keys-in-comprehension Raise an error if an object comprehension contains duplicate162 keys163 --strict-import-syntax Raise an error if import expressions are used without proper164 parentheses, e.g. import "foo".bar rather than (import165 "foo").bar166 --strict-inherited-assertions Properly handle assertions defined in a Jsonnet dictionary167 that is extended more than once168169170```171172</details>173174Rust (alternative):175176```177Usage: rsjsonnet [OPTIONS] <filename>178179Arguments:180 <filename> 181182Options:183 -e, --exec Treat filename as code184 -J, --jpath <dir> Specify an additional library search dir (right-most wins)185 -o, --output-file <file> Write to the output file rather than stdout186 -m, --multi <dir> Write multiple files to the directory, list files on stdout187 -y, --yaml-stream Write output as a YAML stream of JSON documents188 -S, --string Expect a string, manifest as plain text189 -s, --max-stack <n> Number of allowed stack frames190 -t, --max-trace <n> Max length of stack trace before cropping191 -V, --ext-str <var=[val]> 192 --ext-str-file <var=file> 193 --ext-code <var[=code]> 194 --ext-code-file <var=file> 195 -A, --tla-str <var[=val]> 196 --tla-str-file <var=file> 197 --tla-code <var[=code]> 198 --tla-code-file <var=file> 199 -h, --help Print help200201```202203</details>204205206## Real world207208### Graalvm CI209210> Note: No results for C++, takes longer than a hour211212<details>213<summary>Source</summary>214215```jsonnet216# Common217local common = import 'common.jsonnet';218local graal_common = import 'graal-common.json';219220# Compiler221local compiler = import 'compiler/ci/ci.jsonnet';222223# GraalWasm224local wasm = import 'wasm/ci/ci.jsonnet';225226# Espresso227local espresso = import 'espresso/ci/ci.jsonnet';228229# Regex230local regex = import 'regex/ci/ci.jsonnet';231232# SDK233local sdk = import 'sdk/ci/ci.jsonnet';234235# SubstrateVM236local substratevm = import 'substratevm/ci/ci.jsonnet';237238# Sulong239local sulong = import 'sulong/ci/ci.jsonnet';240241# Tools242local tools = import 'tools/ci/ci.jsonnet';243244# Truffle245local truffle = import 'truffle/ci/ci.jsonnet';246247# JavaDoc248local javadoc = import "ci_includes/publish-javadoc.jsonnet";249250# VM251local vm = import 'vm/ci/ci_includes/vm.jsonnet';252253local verify_ci = (import 'ci-check.libsonnet').verify_ci;254255{256 # Ensure that entries in common.jsonnet can be resolved.257 _checkCommon: (import 'common.jsonnet'),258 ci_resources:: (import 'ci-resources.libsonnet'),259 overlay: graal_common.ci.overlay,260 specVersion: "3",261 builds: [common.add_excludes_guard(b) for b in (262 compiler.builds +263 wasm.builds +264 espresso.builds +265 regex.builds +266 sdk.builds +267 substratevm.builds +268 sulong.builds +269 tools.builds +270 truffle.builds +271 javadoc.builds +272 vm.builds273 )],274 assert verify_ci(self.builds),275 // verify that the run-spec demo works276 assert (import "ci/ci_common/run-spec-demo.jsonnet").check(),277}278279```280</details>281282| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |283|:---|---:|---:|---:|---:|284| `Rust` | 93.6 ± 0.6 | 92.5 | 94.7 | 1.00 |285| `Rust (alternative, rsjsonnet)` | 263.3 ± 1.8 | 259.0 | 268.4 | 2.81 ± 0.03 |286| `Go` | 1204.6 ± 5.0 | 1196.0 | 1215.4 | 12.87 ± 0.10 |287| `Scala` | 720.0 ± 2.9 | 713.4 | 725.3 | 7.70 ± 0.06 |288289### Kube-prometheus manifests290291<details>292<summary>Source</summary>293294```jsonnet295local kp =296 (import 'kube-prometheus/main.libsonnet') +297 // Uncomment the following imports to enable its patches298 // (import 'kube-prometheus/addons/anti-affinity.libsonnet') +299 // (import 'kube-prometheus/addons/managed-cluster.libsonnet') +300 // (import 'kube-prometheus/addons/node-ports.libsonnet') +301 // (import 'kube-prometheus/addons/static-etcd.libsonnet') +302 // (import 'kube-prometheus/addons/custom-metrics.libsonnet') +303 // (import 'kube-prometheus/addons/external-metrics.libsonnet') +304 // (import 'kube-prometheus/addons/pyrra.libsonnet') +305 {306 values+:: {307 common+: {308 namespace: 'monitoring',309 },310 },311 };312313{ 'setup/0namespace-namespace': kp.kubePrometheus.namespace } +314{315 ['setup/prometheus-operator-' + name]: kp.prometheusOperator[name]316 for name in std.filter((function(name) name != 'serviceMonitor' && name != 'prometheusRule'), std.objectFields(kp.prometheusOperator))317} +318// { 'setup/pyrra-slo-CustomResourceDefinition': kp.pyrra.crd } +319// serviceMonitor and prometheusRule are separated so that they can be created after the CRDs are ready320{ 'prometheus-operator-serviceMonitor': kp.prometheusOperator.serviceMonitor } +321{ 'prometheus-operator-prometheusRule': kp.prometheusOperator.prometheusRule } +322{ 'kube-prometheus-prometheusRule': kp.kubePrometheus.prometheusRule } +323{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +324{ ['blackbox-exporter-' + name]: kp.blackboxExporter[name] for name in std.objectFields(kp.blackboxExporter) } +325{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } +326// { ['pyrra-' + name]: kp.pyrra[name] for name in std.objectFields(kp.pyrra) if name != 'crd' } +327{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +328{ ['kubernetes-' + name]: kp.kubernetesControlPlane[name] for name in std.objectFields(kp.kubernetesControlPlane) }329{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +330{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +331{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) }332333```334</details>335336| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |337|:---|---:|---:|---:|---:|338| `Rust` | 129.4 ± 1.4 | 127.7 | 132.8 | 1.00 |339| `Rust (alternative, rsjsonnet)` | 197.0 ± 1.9 | 193.6 | 200.7 | 1.52 ± 0.02 |340| `Go` | 2127.7 ± 13.8 | 2105.4 | 2151.5 | 16.44 ± 0.21 |341| `Scala` | 947.9 ± 11.1 | 926.1 | 967.9 | 7.33 ± 0.12 |342| `C++` | 87633.8 ± 569.9 | 86464.2 | 89118.8 | 677.29 ± 8.72 |343344## Benchmarks from C++ jsonnet (/perf_tests)345346### Large string join347348<details>349<summary>Source</summary>350351```jsonnet352{353 text: std.join(',', std.makeArray(76846, function(_) 'x')),354}355356```357</details>358359| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |360|:---|---:|---:|---:|---:|361| `Rust` | 5.6 ± 0.1 | 5.4 | 6.2 | 1.00 |362| `Rust (alternative, rsjsonnet)` | 45.3 ± 0.9 | 43.5 | 47.8 | 8.04 ± 0.25 |363| `Go` | 98.2 ± 1.6 | 95.0 | 100.8 | 17.45 ± 0.50 |364| `Scala` | 331.1 ± 5.8 | 322.3 | 343.7 | 58.79 ± 1.73 |365| `C++` | 76.5 ± 0.7 | 75.4 | 78.0 | 13.59 ± 0.34 |366367### Large string template368369> Note: No results for Go, fails with os stack size exhausion370371| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |372|:---|---:|---:|---:|---:|373| `Rust` | 6.7 ± 0.1 | 6.4 | 7.1 | 1.00 |374| `Rust (alternative, rsjsonnet)` | 7.1 ± 0.2 | 6.8 | 7.6 | 1.05 ± 0.03 |375| `Scala` | 392.7 ± 2.7 | 388.2 | 399.8 | 58.29 ± 1.19 |376| `C++` | 14376.2 ± 35.8 | 14317.5 | 14448.6 | 2133.86 ± 41.53 |377378### Realistic 1379380<details>381<summary>Source</summary>382383```jsonnet384local utils = {385 Func3(aaaaaaa, bbbbbbb, cccc)::386 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/%s/XXXXX/%s/XXXXXXXXXXXXXXX/%s'387 % [aaaaaaa, bbbbbbb, cccc],388};389390391local long_list = [392 '001xxxxxxxxxxxxxxx-xxx',393 '002xxxxxxxxxxxxxxxxxx-xxx',394 '003xxxxxxxxxxxxxxxx-xxxxxxx',395 '004xxxxxx-xxxxxx',396 '005xxxx-xxx-xxxx',397 '006xxx-xxx-xxxxxx',398 '007xxx-xxx-xxxx-xxxx',399 '008xxx-xxx-xxxx-xxxx-xxxxxxx',400 '009xxx-xxx-xxxxx-xxxx-xxxxxxx-xxxxxx',401 '010xxx-xxx-xxxx-xxxxxxx-xxxxxx-xxxxxxx',402 '011xxx-xxx-xxxxx-xxxxxxxx-xxxxxxx',403 '012xxx-xxx-xxxx-xxxxxxxx-xxxxxxx-xxxxxx',404 '013xxx-xxx-xxxx-xxxxxxxxxx',405 '014xxx-xxx-xxxxx-xxxxxx-xx',406 '015xxx-xxx-xxxxxx-xxxxxxx',407 '016xxx-xxx-xxxx-xxxxxxxx-xxxxx',408 '017xxx-xxx-xxxx-xxxxxxxxxxxxxxx',409 '018xxx-xxx-xxxx-xxxxxxxx-xxxxxxx-xxxxxxx',410 '019xxx-xxx-xxxx-xxxxxxxx-xx',411 '020xxx-xxx-xxxx-xxxxxxxxxxxxxxxx',412 '021xxx-xxx-xxxx-xxxxxxxx-xxxxxxxxxxxx-xxx',413 '022xxx-xxxx-xxxx-xxxx-xxxxxxx',414 '023xxx-xxxx-xxxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',415 '024xxx-xxx-xxxx-xxx-xxxx-xxxx-xxx-xxxxxxxxx',416 '025xxx-xxxx-xxxx-xxxxxxxxx',417 '026xxx-xxx-xxxx-xxx-xxxxxxx',418 '027xxx-xxx-xxxx-xxx-xxxxxxx',419 '028xxx-xxx-xxxx-xxxxxxxxxx',420 '029xxx-xxx-xxxx-xxxxxx',421 '030xxx-xxx-xxxx-xxx-xxxxxxx',422 '031xxx-xxx-xxxx-xxx-xxxxxxxx',423 '032xxx-xxx-xxxxx-xxxxxxxxxxxx-xxxxxxx',424 '033xxx-xxx-xxxx-xxx-xxxx-xxxx',425 '034xxx-xxx-xxxx-xxx-xxxxxxxx-xxxxxxxx',426 '035xxx-xxx-xxxx-xxxxxxx',427 '036xxx-xxx-xxxx-xxxxxxxx-xxxxxxx',428 '037xxx-xxx-xxxx-xxxxxx',429 '038xxx-xxx-xxxx-xxxxxxxxxx',430 '039xxxx-xxx-xxxx-xxxxxx-xxxxxx-xxxxxxx',431 '040xxx-xxx-xxxx-xxxxxx-xxxxxxx',432 '041xxxx-xxx-xxxx-xxxxxx-xx',433 '042xxx-xxx-xxxx-xxxxxxxxxxx',434 '043xxx-xxx-xxxx-xxxxxxxxxxx-xxxxxxx',435 '044xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxx',436 '045xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxx',437 '046xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxx',438 '047xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxxxxxx',439 '048xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxxxxxxx',440 '049xxx-xxx-xxxx-xxxxxx-xxx-xxxxxx-xxxxxxxxx',441 '050xxx-xxx-xxxxx-xxxxx-xxxxxxx',442 '051xxx-xxx-xxxx-xxxxx-xxxxxxxx-xxxxxx',443 '052xxx-xxx-xxxx-xxxxx-xx',444 '053xxx-xxx-xxxx-xxxx-xxxxxxx-xxx-xxxxxxx',445 '054xxx-xxx-xxxx-xxxx-xxxxxxx-xxx-xxxxxx',446 '055xxx-xxx-xxxx-xxx',447 '056xxx-xxx-xxxx-xxxxxxx-xxxxxxx',448 '057xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxxx',449 '058xxx-xxx-xxxx-xxxxxxxxx-xxxxxx-xxxxxxx',450 '059xxx-xxx-xxxx-xx-xxxxxxxxxxx-xxxxx',451 '060xxx-xxx-xxxx-xxxxxxxxxxxxxx-xxxxxxx',452 '061xxx-xxx-xxxx-xxxxxxxx-xxxxxxx',453 '062xxx-xxx-xxxx-xxxxxxxxxxxxx-xxxxxxx',454 '063xxx-xxx-xxxx-xxxxxx-xxxxxxx',455 '064xxx-xxx-xxxxx-xxxxxx-xxxxxxx',456 '065xxx-xxx-xxxx-xxxxx-xxxxx',457 '066xxx-xxx-xxxx-xxxxx-xxxx',458 '067xxx-xxx-xxxx-xxxxxxxxxxxxxxxxx',459 '068xxx-xxx-xxxx-xxxxxxxx-xxxxx-xxx',460 '069xxx-xxx-xxxx-xxxxxxxx-xx-xxx-xxxxxxxx',461 '070xxx-xxx-xxxx-xxxxxxxx-xxxxxx-xxxxxxx',462 '071xxx-xxx-xxxx-xxxxxxxxxx',463 '072xxx-xxxx-xxxx-xxxxxxxxxxxxxxxx',464 '073xxx-xxx-xxxx-xxxxxx-xxxxxx-xxxxxxx',465 '074xxx-xxx-xxxx-xxxxxxx-xxxxxxxxxxxxx',466 '075xxx-xxx-xxxx-xxxxxxx-xxxxxxxxxxxxx-xxxxxxxxx',467 '076xxx-xxx-xxxx-xxxxxxxxxxxxx-xxxxxxx',468 '077xxx-xxx-xxxx-xxxxxxxxx-xxxxxxx-x2',469 '078xxx-xxx-xxxx-xxx',470 '079xxx-xxx-xxxx-xxxxxxxxxxxx',471 '080xxx-xxx-xxxx-xxxxxxxxx-xxxxxxxx',472 '081xxx-xxx-xxxx-xxxxxxxx-xxxxxxxxx',473 '082xxx-xxx-xxxx-xxxxxxxxx',474 '083xxx-xxx-xxxx-xxxxxxx',475 '084xxx-xxx-xxxx-xxxxxxx-xxxxxx',476 '085xxxx-xxx-xxxxxxx-xxxxx-xxxx',477 '086xxx-xxx-xxxxxxxx-xxxx-xxxxxxxxxx',478 '087xxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',479 '088xxx-xxx-xxxxxxx-xxxxxxxx',480 '089xxx-xxx-xxxxxxxx-xxxxxxx',481 '090xxx-xxx-xxxxxxxx-xxxxxxx-xxxxxx',482 '091xxx-xxxx-xxxxxxxxxx',483 '092xxx-xxx-xxxxxx-xx',484 '093xxx-xxx-xxxxxxx',485 '094xxx-xxx-xxxxxxx-xxxxx',486 '095xxx-xxx-xxxxxxxxxx',487 '096xxx-xxx-xxxxxxxxxxxxxxx',488 '098xxx-xxx-xxxxxxxxxxxxxxxxx',489 '098xxx-xxx-xxxxxxxx-xxxxxxx-xxxxxxx',490 '099xxx-xxx-xxxxxxxx-xx',491 '100xxx-xxx-xxxx-xxxxxxxxxxx-xxxxxxx',492 '101xxx-xxxx-xxxxxxxxxxxxxxxx',493 '102xxx-xxx-xxxxxxxxxxxxxxxxxx',494 '103xxx-xxx-xxxxxxxx-xxxxxxxxxxxx-xxx',495 '104xxx-xxx-xxxx-xxxxxxx',496 '105xxx-xxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',497 '106xxx-xxx-xxx-xxxx-xxxx-xxx-xxxxxxxxx',498 '107xxx-xxx-xxxxxxxxx',499 '108xxx-xxx-xxx-xxxxxxx',500 '109xxx-xxx-xxx-xxxxxxx',501 '110xxx-xxxx-xxxxx',502 '111xxx-xxx-xxx-xxxx-xxxx',503 '112xxx-xxx-xxx-xxxxxxx',504 '113xxx-xxx-xxx-xxxxxxx',505 '114xxx-xxx-xxxxxxxxxxxx-xxxxxxx',506 '115xxx-xxx-xxx-xxxx-xxxx',507 '116xxx-xxx-xxx-xxxxxxxx-xxxxxxxx',508 '117xxx-xxx-xxxxxxx',509 '118xxx-xxx-xxxxxxxx-xxxxxxx',510 '119xxx-xxx-xxxxxx',511 '120xxxx-xxx-xxxxxxxxxx',512 '121xxx-xxx-xxxxxx-xxxxxx-xxxxxxx',513 '122xxx-xxx-xxxxxx-xxxxxxx',514 '123xxx-xxx-xxxxxx-xx',515 '124xxxx-xxx-xxx-xxxx-xxxxxxx',516 '125xxx-xxx-xxxxxxxxxxx',517 '126xxx-xxx-xxxxxxxxxxx-xxxxxxx',518 '127xxx-xxx-xxxxxx-xxx-xxxxxx',519 '128xxx-xxx-xxxxxxxxxx',520 '129xxx-xxx-xxxxxxxxxx-xxx',521 '130xxx-xxx-xxxxx-xxxxxxx',522 '131xxx-xxx-xxxxxx-xxxxxxxx-xxx',523 '132xxx-xxx-xxxxx-xxxxxxxx-xxxxxx',524 '133xxx-xxx-xxxxx-xx',525 '134xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxxx',526 '135xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxx',527 '136xxx-xxx-xxxxxxxxxxxxxxx',528 '137xxx-xxx-xxx',529 '138xxx-xxx-xxxxxxx-xxxxxxx',530 '139xxx-xxx-xxxxxxx-xxx-xxxxxxx',531 '140xxx-xxx-xxxxxxxxx-xxxxxx-xxxxxxx',532 '141xxx-xxx-xxxxxxxxxx-xxxx-xxxxxxx',533 '142xxx-xxx-xx-xxxxxxxxxx-xxxxx',534 '143xxx-xxx-xxxxxxxxxxxxxx-xxxxxxx',535 '144xxx-xxx-xxxxxxxxxxxxxxxxx',536 '145xxx-xxx-xxxxxxxx-xxxxxxx',537 '146xxx-xxx-xxxxxxxxxxxxx-xxxxxxx',538 '147xxx-xxx-xxxxxxx-xxxxxxx',539 '148xxx-xxx-xxxxxx-xxxxxxx',540 '149xxx-xxx-xxxxx-xxxxx',541 '150xxx-xxx-xxxxx-xxxx',542 '151xxx-xxx-xxxxxxxxxxxxxxxxx',543 '152xxx-xxx-xxxxxxxxxxxxxxxxxxx',544 '153xxx-xxx-xxxxxxxxx-xxxxx-xxx',545 '154xxx-xxx-xxxxxxxx-xxxxx-xxxx-xxxx',546 '155xxx-xxx-xxxxxxxx-xxxxxxxxxxxx-xxxx',547 '156xxx-xxx-xxxxxxxx-xx-xxx-xxxxxxxx',548 '157xxx-xxx-xxxxxxxx-xxxxxx-xxxxxxx',549 '158xxx-xxx-xxxxxxxxxx',550 '159xxx-xxx-xxxx-xxxxxx',551 '160xxx-xxx-xxxxxxxxxx',552 '161xxx-xxx-xxxxxxxxxxxxx',553 '162xxx-xxx-xxxxxxxxxxxxxxxx',554 '163xxx-xxx-xxxxx-xxxxxx-xxxxxxx',555 '164xxx-xxx-xxxxxxx-xxxxxxxxxxxxx',556 '165xxx-xxx-xxxxxxxxxxxxxx-xxxxxxx',557 '166xxx-xxx-xxxxxxxxx-xxxxxxx-x2',558 '167xxx-xxx-xxx',559 '168xxx-xxx-xxxxxxxxxxxx',560 '169xxx-xxx-xxxxxxxxx-xxxxxxxx',561 '170xxx-xxx-xxxxxxxxx-xxx-xxxxxxx',562 '171xxx-xxx-xxxxxxxxx',563 '172xxx-xxxx-xxxxxxxxx',564 '173xxx-xxx',565 '174xxx-xxxxxx-xxxxxxx',566 '175xxx-xxxxxx-xxxxxx-xxxx',567 '176xxx-xxxxxx-xxxxx',568 '177xxx-xxxxx-xxxxxxxx',569 '178xxx-xxxxxx',570 '179xxx-xxxxxxx-xxxx',571 '180xxx-xxxxxxx-xxxx-xxxx',572 '181xxx-xxxxxxx-xxxx-xxxxxxx',573 '182xxx-xxxxxxx-xxxx-xxxxxxxxxxxxxxx',574 '183xxx-xxxxxxxx-xxxx-xxxxx',575 '184xxx-xxxxxxx-xxxx-xxxxxxx',576 '185xxx-xxxxxxx-xxxx-xxxxxxxx-xxxxxxx',577 '186xxx-xxxxxxx-xxxx-xxx',578 '187xxx-xxxxxxx-xxxx-xxxxxxx-xxx-xxxxxxx',579 '188xxx-xxxxxxx-xxxx-xxxxxxxxxxxxxx-xxxxxxx',580 '189xxx-xxxxxxxx-xxxx-xxxxxxxxxxxxxxxxx',581 '190xxx-xxxxxxx-xxxx-xxxxx-xxxxxx-xxxxxxx',582 '191xxx-xxxxxxx-xxxxxxxxxx',583 '192xxx-xxxxxxx-xxxxxxx',584 '193xxx-xxxxxxx-xxxxxxxxxxxxxxx',585 '194xxx-xxxxxxx-xxxxx',586 '195xxx-xxxxxxx-xxxxxxx',587 '196xxx-xxxxxxx-xxxxxxxx-xxxxxxx',588 '197xxx-xxxxxxx-xxx',589 '198xxx-xxxxxxx-xxxxxxx-xxx-xxxxxxx',590 '199xxx-xxxxxxx-xxxxxxxxxxxxxx-xxxxxxx',591 '200xxx-xxxxxxxx-xxxxxxxxxxxxxxxxx',592 '201xxx-xxxxxxx-xxxxx-xxxxxx-xxxxxxx',593 '202xxx-xxx',594 '203xxx-xxx-xxxxxx',595 '204xxxxxxxxx-xxx',596 '205xxxxxxxxxxx-xxx',597 '206xxxxxxxxx-xxxxxxx',598 '207xxxx-xxxxxx-xxxxxxxxxxx-xxxxx1',599 '208xxxx-xxxxxxxx-xxxxxxxx-xxxxx1',600 '209xxxx-xxxxxxx-xxxxxxx-xxxxx1',601 '209xxxx-xxxxxxx-xxxxxxx-xxxxx2',602 '210xxxx-xxxx-xxxxxxx-xxxxx1',603 '211xxxx-xxxxx-xxxxxxxx1-xxxxx1',604 '212xxxx-xxxx-xxxxxxxx2-xxxxx1',605 '213xxxx-xxxx-xxxxxxx1-xxxxx1',606 '214xxxx-xxxx-xxxxxxx2-xxxxx1',607 '215xxxxxxxxx-xxxxxx',608 '216xxxxxxxxx-xxxxxxx',609 '217xxxxxxxxx-xxxx',610];611612{613 'yyyyyyyyy': {614 local Func3(z, n) = utils.Func3('yyyyyyyyy', z, n),615616 global: {617 [n]: {618 members: [619 Func3(z, '%s-gggg-%s-%s' % [n, z, suffix]),620 for z in ['ooooooo-a', 'ooooooo-b', 'ooooooo-c',621 'ooooooo-a', 'ooooooo-b', 'ooooooo-c']622 for suffix in ['a', 'b', 'c']623 ],624 }625 for n in long_list626 },627 },628}629630```631</details>632633| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |634|:---|---:|---:|---:|---:|635| `Rust` | 12.6 ± 0.1 | 12.3 | 12.9 | 1.00 |636| `Rust (alternative, rsjsonnet)` | 49.7 ± 1.0 | 47.3 | 53.0 | 3.96 ± 0.09 |637| `Go` | 6858.1 ± 34.9 | 6815.9 | 6951.8 | 546.32 ± 6.87 |638| `Scala` | 382.3 ± 3.9 | 371.7 | 387.1 | 30.46 ± 0.47 |639| `C++` | 24472.7 ± 155.7 | 24230.3 | 24799.3 | 1949.51 ± 25.63 |640641### Realistic 2642643<details>644<summary>Source</summary>645646```jsonnet647local rfc3339(timestamp) = '1970-01-01T00:00:00Z';648649local name1(a, b, c) =650 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%sBBBBBBB%sCCCCCCCCCCC%s'651 % [a, b, c];652653local name2(x) =654 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%s' % x;655656local T1 = 'PPPPPPPPPPPPPPPPPPPPPPP';657local T2 = 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ';658659local LOCATIONS = [660 'europe-west1-b',661 'europe-west1-c',662 'europe-west1-d',663 'europe-west2-a',664 'europe-west2-b',665 'europe-west2-c',666 'europe-west3-a',667 'europe-west3-b',668 'europe-west3-c',669 'europe-west4-a',670 'europe-west4-b',671 'europe-west4-c',672 'us-central1-a',673 'us-central1-b',674 'us-central1-c',675 'us-central1-f',676 'us-east1-b',677 'us-east1-c',678 'us-east1-d',679 'us-east4-a',680 'us-east4-b',681 'us-east4-c',682 'us-west1-a',683 'us-west1-b',684 'us-west1-c',685];686687688// The return value is a function to allow it to be parameterized.689function(690 timestamp=0,691 x='xxxxxxxxxxxxxxxxxxx',692 prefix='prefix',693 num1=50,694 count=25,695 offset=0,696)697 local rfc_timestamp = rfc3339(timestamp);698699 local func1(i) =700 local location = LOCATIONS[i % std.length(LOCATIONS)];701 [702 local name = '%s-%000d-%000d' % [prefix, i, j];703 {704 field_zz1: rfc_timestamp,705 fie_z2: {706 field_z3: name1(x, location, name),707 field_zzzzzzzzzz4: name2(x),708 field_zzz5: [name],709 field_z6: T1,710 field_z7: location,711 fi_8: '???',712 fiel_z9: '99',713 },714 }715 for j in std.range(0, num1 - 1)716 ];717718 local func2(i) =719 local location = LOCATIONS[i % std.length(LOCATIONS)];720 local all = [721 name1(x, location, '%s-%000d-%000d' % [prefix, i, j])722 for j in std.range(0, num1 - 1)723 ];724 [725 {726 field_yy1: rfc_timestamp,727 field_yyyyy2: 'EEEE',728 field_yyyyy3: {729 field_y4: T2,730 field_yyyyyyy5: p,731 field_yyyyyyy6: q,732 },733 }734 for p in all735 for q in all736 if p != q737 ];738739740 {741 field_x1: '-----',742 field_xxxxxxxxxxxxxxxx2: std.join([], [743 func1(offset * count + i)744 for i in std.range(0, count - 1)745 ]),746 field_xxxxxxxxxxxxxxxxxxxxxx3: std.join([], [747 func2(offset * count + i)748 for i in std.range(0, count - 1)749 ]),750 }751752753```754</details>755756| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |757|:---|---:|---:|---:|---:|758| `Rust` | 259.9 ± 4.4 | 250.9 | 266.7 | 1.00 |759| `Rust (alternative, rsjsonnet)` | 550.2 ± 16.6 | 531.9 | 600.7 | 2.12 ± 0.07 |760| `Go` | 6732.4 ± 51.4 | 6660.2 | 6858.6 | 25.90 ± 0.48 |761| `Scala` | 675.4 ± 10.9 | 667.3 | 720.0 | 2.60 ± 0.06 |762| `C++` | 26414.5 ± 259.9 | 25948.9 | 26934.4 | 101.63 ± 1.99 |763764## Benchmarks from C++ jsonnet (/benchmarks)765766### Tail call767768<details>769<summary>Source</summary>770771```jsonnet772/*773Copyright 2015 Google Inc. All rights reserved.774775Licensed under the Apache License, Version 2.0 (the "License");776you may not use this file except in compliance with the License.777You may obtain a copy of the License at778779 http://www.apache.org/licenses/LICENSE-2.0780781Unless required by applicable law or agreed to in writing, software782distributed under the License is distributed on an "AS IS" BASIS,783WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.784See the License for the specific language governing permissions and785limitations under the License.786*/787788local sum(x) =789 if x == 0 then790 0791 else792 x + sum(x - 1);793sum(300)794795```796</details>797798| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |799|:---|---:|---:|---:|---:|800| `Rust` | 1.8 ± 0.1 | 1.6 | 2.6 | 1.00 |801| `Rust (alternative, rsjsonnet)` | 3.1 ± 0.1 | 2.8 | 3.4 | 1.69 ± 0.12 |802| `Go` | 5.3 ± 0.2 | 4.9 | 5.9 | 2.90 ± 0.20 |803| `Scala` | 287.4 ± 1.2 | 285.4 | 288.9 | 156.55 ± 9.92 |804| `C++` | 32.1 ± 0.3 | 31.6 | 33.0 | 17.49 ± 1.12 |805806### Inheritance recursion807808<details>809<summary>Source</summary>810811```jsonnet812/*813Copyright 2015 Google Inc. All rights reserved.814815Licensed under the Apache License, Version 2.0 (the "License");816you may not use this file except in compliance with the License.817You may obtain a copy of the License at818819 http://www.apache.org/licenses/LICENSE-2.0820821Unless required by applicable law or agreed to in writing, software822distributed under the License is distributed on an "AS IS" BASIS,823WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.824See the License for the specific language governing permissions and825limitations under the License.826*/827828local Fib = {829 n: 1,830 local outer = self,831 r: if self.n <= 1 then 1 else (Fib { n: outer.n - 1 }).r + (Fib { n: outer.n - 2 }).r,832};833834(Fib { n: 25 }).r835836```837</details>838839| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |840|:---|---:|---:|---:|---:|841| `Rust` | 376.1 ± 5.2 | 364.3 | 383.7 | 1.00 |842| `Rust (alternative, rsjsonnet)` | 496.7 ± 13.0 | 470.6 | 506.8 | 1.32 ± 0.04 |843| `Go` | 873.9 ± 7.1 | 859.3 | 888.0 | 2.32 ± 0.04 |844| `Scala` | 420.8 ± 6.3 | 413.9 | 437.1 | 1.12 ± 0.02 |845| `C++` | 2647.5 ± 14.2 | 2630.9 | 2675.6 | 7.04 ± 0.10 |846847### Simple recursive call848849<details>850<summary>Source</summary>851852```jsonnet853/*854Copyright 2015 Google Inc. All rights reserved.855856Licensed under the Apache License, Version 2.0 (the "License");857you may not use this file except in compliance with the License.858You may obtain a copy of the License at859860 http://www.apache.org/licenses/LICENSE-2.0861862Unless required by applicable law or agreed to in writing, software863distributed under the License is distributed on an "AS IS" BASIS,864WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.865See the License for the specific language governing permissions and866limitations under the License.867*/868869local fibonacci(n) =870 if n <= 1 then871 1872 else873 fibonacci(n - 1) + fibonacci(n - 2);874875fibonacci(25)876877```878</details>879880| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |881|:---|---:|---:|---:|---:|882| `Rust` | 81.3 ± 0.3 | 80.9 | 82.4 | 1.00 |883| `Rust (alternative, rsjsonnet)` | 202.3 ± 12.0 | 183.1 | 237.6 | 2.49 ± 0.15 |884| `Go` | 349.4 ± 1.7 | 347.2 | 354.2 | 4.30 ± 0.03 |885| `Scala` | 322.5 ± 3.0 | 318.7 | 330.7 | 3.97 ± 0.04 |886| `C++` | 193.5 ± 0.9 | 191.4 | 194.8 | 2.38 ± 0.01 |887888### Foldl string concat889890<details>891<summary>Source</summary>892893```jsonnet894std.foldl(function(e, res) e + res, std.makeArray(20000, function(i) 'aaaaa'), '')895896```897</details>898899| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |900|:---|---:|---:|---:|---:|901| `Rust` | 8.9 ± 0.1 | 8.6 | 9.3 | 1.00 |902| `Rust (alternative, rsjsonnet)` | 303.1 ± 3.8 | 297.6 | 308.1 | 34.06 ± 0.68 |903| `Go` | 50.9 ± 0.8 | 48.3 | 52.2 | 5.72 ± 0.13 |904| `Scala` | 550.6 ± 5.5 | 542.8 | 563.7 | 61.86 ± 1.13 |905| `C++` | 902.6 ± 4.8 | 891.4 | 912.1 | 101.41 ± 1.65 |906907### Array sorts908909> Note: No results for Scala, sjsonnet doesn't support keyF in std.sort: https://github.com/databricks/sjsonnet/issues/204910911<details>912<summary>Source</summary>913914```jsonnet915// A benchmark for builtin sort916917local reverse = std.reverse;918local sort = std.sort;919920true921&& std.assertEqual(std.range(1, 500), sort(std.range(1, 500)))922&& std.assertEqual(std.range(1, 1000), sort(std.range(1, 1000)))923&& std.assertEqual(reverse(std.range(1, 1000)), sort(std.range(1, 1000), keyF=function(x) -x))924&& std.assertEqual(std.range(1, 1000), sort(reverse(std.range(1, 1000))))925&& std.assertEqual(std.makeArray(2000, function(i) std.floor((i + 2) / 2)), sort(std.range(1, 1000) + reverse(std.range(1, 1000))))926927```928</details>929930| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |931|:---|---:|---:|---:|---:|932| `Rust` | 3.2 ± 0.2 | 2.9 | 4.1 | 1.00 |933| `Rust (alternative, rsjsonnet)` | 14.4 ± 0.6 | 13.1 | 16.2 | 4.46 ± 0.28 |934| `Go` | 12.1 ± 0.2 | 11.4 | 12.8 | 3.74 ± 0.20 |935| `C++` | 3637.1 ± 24.9 | 3557.4 | 3664.7 | 1128.64 ± 56.81 |936937### Lazy array938939<details>940<summary>Source</summary>941942```jsonnet943local f2(f) = function(x) f(f(x));944local id(x) = x;945946local slowId = std.makeArray(20, function(i) if i == 0 then id else f2(slowId[i - 1]));947948slowId[15](42)949950```951</details>952953| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |954|:---|---:|---:|---:|---:|955| `Rust` | 54.1 ± 1.1 | 52.3 | 56.3 | 1.30 ± 0.03 |956| `Rust (alternative, rsjsonnet)` | 41.7 ± 0.7 | 39.6 | 43.8 | 1.00 |957| `Go` | 596.5 ± 5.2 | 585.1 | 606.9 | 14.30 ± 0.29 |958| `Scala` | 306.6 ± 1.6 | 303.5 | 310.4 | 7.35 ± 0.14 |959| `C++` | 184.5 ± 1.8 | 182.0 | 187.9 | 4.42 ± 0.09 |960961### Inheritance function recursion962963<details>964<summary>Source</summary>965966```jsonnet967local fibnext = {968 a: super.a + super.b,969 b: super.a,970};971local fib(n) =972 if n == 0 then973 { a: 1, b: 1 }974 else975 fib(n - 1) + fibnext;976977fib(25)978979```980</details>981982| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |983|:---|---:|---:|---:|---:|984| `Rust` | 1.6 ± 0.1 | 1.5 | 2.5 | 1.00 |985| `Rust (alternative, rsjsonnet)` | 2.9 ± 0.1 | 2.7 | 3.7 | 1.78 ± 0.13 |986| `Go` | 2.4 ± 0.1 | 2.1 | 2.9 | 1.48 ± 0.12 |987| `Scala` | 293.2 ± 1.5 | 289.9 | 296.1 | 178.20 ± 12.35 |988| `C++` | 999.1 ± 9.2 | 974.4 | 1010.9 | 607.23 ± 42.34 |989990### String strips991992<details>993<summary>Source</summary>994995```jsonnet996// This string must be longer than max stack frames997local veryLongString = std.join('', std.repeat(['e'], 510));998999std.assertEqual(std.stripChars(veryLongString + 'ok' + veryLongString, 'e'), 'ok') &&1000std.assertEqual(std.lstripChars(veryLongString + 'ok', 'e'), 'ok') &&1001std.assertEqual(std.rstripChars('ok' + veryLongString, 'e'), 'ok') &&10021003true10041005```1006</details>10071008| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1009|:---|---:|---:|---:|---:|1010| `Rust` | 8.6 ± 0.2 | 8.4 | 9.5 | 1.00 |1011| `Rust (alternative, rsjsonnet)` | 18.4 ± 0.4 | 17.6 | 20.8 | 2.13 ± 0.06 |1012| `Go` | 11.2 ± 0.2 | 10.4 | 11.9 | 1.29 ± 0.04 |1013| `Scala` | 294.9 ± 2.0 | 292.2 | 301.9 | 34.10 ± 0.65 |1014| `C++` | 37345.3 ± 208.2 | 36567.2 | 37689.0 | 4318.10 ± 80.13 |10151016### Big object10171018<details>1019<summary>Source</summary>10201021```jsonnet1022// Generator source1023local n = 2000;10241025local objLocal(name, body) = 'local ' + name + ' = ' + body + ',';1026local objField(name, body) = name + ': ' + body + ',';10271028local allLocals =1029 std.makeArray(n, function(i) objLocal('l' + i, '1'));10301031local allFields =1032 std.makeArray(n, function(i) objField('f' + i, '2'));10331034local indent = ' ';1035local indentAndSeparate(s) = indent + s + '\n';10361037local objContents = std.map(indentAndSeparate, allLocals + allFields);10381039local objectBody = std.join('', objContents);1040'{\n' + objectBody + '}\n'10411042```1043</details>10441045| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1046|:---|---:|---:|---:|---:|1047| `Rust` | 2.2 ± 0.1 | 1.9 | 3.0 | 1.00 |1048| `Rust (alternative, rsjsonnet)` | 3.2 ± 0.1 | 2.9 | 3.5 | 1.46 ± 0.10 |1049| `Go` | 4.1 ± 0.1 | 3.7 | 4.6 | 1.85 ± 0.13 |1050| `Scala` | 292.3 ± 2.9 | 289.3 | 304.0 | 132.11 ± 8.64 |1051| `C++` | 28.3 ± 0.3 | 27.7 | 29.1 | 12.80 ± 0.84 |10521053## Benchmarks from Go jsonnet (builtins)10541055### std.base6410561057<details>1058<summary>Source</summary>10591060```jsonnet1061{1062 foo: [1063 std.base64("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.") for i in std.range(0,100)1064 ],1065}1066```1067</details>10681069| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1070|:---|---:|---:|---:|---:|1071| `Rust` | 2.7 ± 0.1 | 2.4 | 3.4 | 1.00 |1072| `Rust (alternative, rsjsonnet)` | 2195.9 ± 48.5 | 2098.1 | 2229.6 | 804.07 ± 39.58 |1073| `Go` | 17.0 ± 0.3 | 16.1 | 17.7 | 6.22 ± 0.29 |1074| `Scala` | 313.8 ± 1.2 | 311.3 | 316.1 | 114.91 ± 5.07 |1075| `C++` | 14621.6 ± 110.0 | 14473.9 | 14774.9 | 5354.05 ± 238.94 |10761077### std.base64Decode10781079<details>1080<summary>Source</summary>10811082```jsonnet1083{1084 foo: [1085 std.base64Decode("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEuIFNlZCB0dXJwaXMgdGluY2lkdW50IGlkIGFsaXF1ZXQgcmlzdXMuIEVnZXQgbWF1cmlzIHBoYXJldHJhIGV0IHVsdHJpY2VzIG5lcXVlIG9ybmFyZSBhZW5lYW4gZXVpc21vZC4gRGlhbSBxdWlzIGVuaW0gbG9ib3J0aXMgc2NlbGVyaXNxdWUgZmVybWVudHVtLiBWYXJpdXMgZHVpcyBhdCBjb25zZWN0ZXR1ciBsb3JlbSBkb25lYyBtYXNzYSBzYXBpZW4uIERpYW0gc2l0IGFtZXQgbmlzbCBzdXNjaXBpdCBhZGlwaXNjaW5nIGJpYmVuZHVtIGVzdCB1bHRyaWNpZXMgaW50ZWdlci4gTGVjdHVzIHVybmEgZHVpcyBjb252YWxsaXMgY29udmFsbGlzIHRlbGx1cy4gTmliaCBpcHN1bSBjb25zZXF1YXQgbmlzbCB2ZWwgcHJldGl1bSBsZWN0dXMgcXVhbSBpZCBsZW8uIEZldWdpYXQgaW4gYW50ZSBtZXR1cyBkaWN0dW0gYXQgdGVtcG9yIGNvbW1vZG8uIFZlbGl0IGRp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XN0aXF1ZSBzZW5lY3R1cy4gU2NlbGVyaXNxdWUgbWF1cmlzIHBlbGxlbnRlc3F1ZSBwdWx2aW5hciBwZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzLiBTY2VsZXJpc3F1ZSBtYXVyaXMgcGVsbGVudGVzcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4=") for i in std.range(0,100)1086 ],1087}1088```1089</details>10901091| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1092|:---|---:|---:|---:|---:|1093| `Rust` | 2.6 ± 0.1 | 2.3 | 3.1 | 1.00 |1094| `Rust (alternative, rsjsonnet)` | 7889.2 ± 74.7 | 7711.6 | 8051.1 | 3045.22 ± 138.95 |1095| `Go` | 15.2 ± 0.3 | 14.6 | 16.5 | 5.85 ± 0.28 |1096| `Scala` | 313.0 ± 2.5 | 309.5 | 321.2 | 120.80 ± 5.47 |1097| `C++` | 9930.9 ± 26.5 | 9895.0 | 9997.9 | 3833.33 ± 171.41 |10981099### std.base64DecodeBytes11001101<details>1102<summary>Source</summary>11031104```jsonnet1105{1106 foo: [1107 std.base64DecodeBytes("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEuIFNlZCB0dXJwaXMgdGluY2lkdW50IGlkIGFsaXF1ZXQgcmlzdXMuIEVnZXQgbWF1cmlzIHBoYXJldHJhIGV0IHVsdHJpY2Vz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nRlIG1ldHVzIGRpY3R1bSBhdCB0ZW1wb3IgY29tbW9kby4gVmVsaXQgZGlnbmlzc2ltIHNvZGFsZXMgdXQgZXUgc2VtIGludGVnZXIuIERpY3R1bSBzaXQgYW1ldCBqdXN0byBkb25lYy4gU2NlbGVyaXNxdWUgbWF1cmlzIHBlbGxlbnRlc3F1ZSBwdWx2aW5hciBwZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzLiBTY2VsZXJpc3F1ZSBtYXVyaXMgcGVsbGVudGVzcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4gU2NlbGVyaXNxdWUgbWF1cmlzIHBlbGxlbnRlc3F1ZSBwdWx2aW5hciBwZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzLiBTY2VsZXJpc3F1ZSBtYXVyaXMgcGVsbGVudGVzcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4=") for i in std.range(0,100)1108 ],1109}1110```1111</details>11121113| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1114|:---|---:|---:|---:|---:|1115| `Rust` | 34.8 ± 0.5 | 33.4 | 36.0 | 1.00 |1116| `Rust (alternative, rsjsonnet)` | 8116.2 ± 37.2 | 8049.1 | 8176.2 | 233.52 ± 3.24 |1117| `Go` | 271.1 ± 2.3 | 267.1 | 275.7 | 7.80 ± 0.12 |1118| `Scala` | 357.2 ± 2.3 | 353.5 | 363.4 | 10.28 ± 0.15 |1119| `C++` | 9653.7 ± 22.5 | 9621.4 | 9694.3 | 277.75 ± 3.69 |11201121### std.base64 (byte array)11221123<details>1124<summary>Source</summary>11251126```jsonnet1127{1128 foo: [1129 std.base64([76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,76,111,114,101,109,32,105,112,115,117,109,32,100,111,108,111,114,32,115,105,116,32,97,109,101,116,44,32,99,111,110,115,101,99,116,101,116,117,114,32,97,100,105,112,105,115,99,105,110,103,32,101,108,105,116,44,32,115,101,100,32,100,111,32,101,105,117,115,109,111,100,32,116,101,109,112,111,114,32,105,110,99,105,100,105,100,117,110,116,32,117,116,32,108,97,98,111,114,101,32,101,116,32,100,111,108,111,114,101,32,109,97,103,110,97,32,97,108,105,113,117,97,46,32,83,101,100,32,116,117,114,112,105,115,32,116,105,110,99,105,100,117,110,116,32,105,100,32,97,108,105,113,117,101,116,32,114,105,115,117,115,46,32,69,103,101,116,32,109,97,117,114,105,115,32,112,104,97,114,101,116,114,97,32,101,116,32,117,108,116,114,105,99,101,115,32,110,101,113,117,101,32,111,114,110,97,114,101,32,97,101,110,101,97,110,32,101,117,105,115,109,111,100,46,32,68,105,97,109,32,113,117,105,115,32,101,110,105,109,32,108,111,98,111,114,116,105,115,32,115,99,101,108,101,114,105,115,113,117,101,32,102,101,114,109,101,110,116,117,109,46,32,86,97,114,105,117,115,32,100,117,105,115,32,97,116,32,99,111,110,115,101,99,116,101,116,117,114,32,108,111,114,101,109,32,100,111,110,101,99,32,109,97,115,115,97,32,115,97,112,105,101,110,46,32,68,105,97,109,32,115,105,116,32,97,109,101,116,32,110,105,115,108,32,115,117,115,99,105,112,105,116,32,97,100,105,112,105,115,99,105,110,103,32,98,105,98,101,110,100,117,109,32,101,115,116,32,117,108,116,114,105,99,105,101,115,32,105,110,116,101,103,101,114,46,32,76,101,99,116,117,115,32,117,114,110,97,32,100,117,105,115,32,99,111,110,118,97,108,108,105,115,32,99,111,110,118,97,108,108,105,115,32,116,101,108,108,117,115,46,32,78,105,98,104,32,105,112,115,117,109,32,99,111,110,115,101,113,117,97,116,32,110,105,115,108,32,118,101,108,32,112,114,101,116,105,117,109,32,108,101,99,116,117,115,32,113,117,97,109,32,105,100,32,108,101,111,46,32,70,101,117,103,105,97,116,32,105,110,32,97,110,116,101,32,109,101,116,117,115,32,100,105,99,116,117,109,32,97,116,32,116,101,109,112,111,114,32,99,111,109,109,111,100,111,46,32,86,101,108,105,116,32,100,105,103,110,105,115,115,105,109,32,115,111,100,97,108,101,115,32,117,116,32,101,117,32,115,101,109,32,105,110,116,101,103,101,114,46,32,68,105,99,116,117,109,32,115,105,116,32,97,109,101,116,32,106,117,115,116,111,32,100,111,110,101,99,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115,46,32,83,99,101,108,101,114,105,115,113,117,101,32,109,97,117,114,105,115,32,112,101,108,108,101,110,116,101,115,113,117,101,32,112,117,108,118,105,110,97,114,32,112,101,108,108,101,110,116,101,115,113,117,101,32,104,97,98,105,116,97,110,116,32,109,111,114,98,105,32,116,114,105,115,116,105,113,117,101,32,115,101,110,101,99,116,117,115]),for i in std.range(0,100)1130 ],1131}1132```1133</details>11341135| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1136|:---|---:|---:|---:|---:|1137| `Rust` | 30.3 ± 0.4 | 29.1 | 31.6 | 1.00 |1138| `Rust (alternative, rsjsonnet)` | 1460.8 ± 47.6 | 1375.2 | 1568.3 | 48.26 ± 1.72 |1139| `Go` | 156.5 ± 1.9 | 152.5 | 159.4 | 5.17 ± 0.10 |1140| `Scala` | 355.9 ± 2.9 | 351.4 | 365.6 | 11.76 ± 0.20 |1141| `C++` | 13362.4 ± 88.3 | 13028.4 | 13473.8 | 441.41 ± 7.01 |11421143### std.foldl11441145<details>1146<summary>Source</summary>11471148```jsonnet1149local input = std.makeArray(10000, function(i) 'xxxxx');11501151std.foldl(function(acc, value) acc + value, input, '')11521153```1154</details>11551156| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1157|:---|---:|---:|---:|---:|1158| `Rust` | 5.3 ± 0.2 | 5.0 | 6.2 | 1.00 |1159| `Rust (alternative, rsjsonnet)` | 81.5 ± 1.6 | 78.9 | 83.8 | 15.38 ± 0.55 |1160| `Go` | 26.6 ± 0.5 | 25.0 | 27.5 | 5.02 ± 0.18 |1161| `Scala` | 405.4 ± 3.0 | 400.9 | 413.6 | 76.52 ± 2.34 |1162| `C++` | 265.3 ± 2.7 | 260.6 | 271.5 | 50.08 ± 1.57 |11631164### std.manifestJsonEx11651166<details>1167<summary>Source</summary>11681169```jsonnet1170{1171 bar: {1172 prometheusOperator+: {1173 service+: {1174 spec+: {1175 ports: [1176 {1177 name: 'https',1178 port: 8443,1179 targetPort: 'https',1180 },1181 ],1182 },1183 },1184 serviceMonitor+: {1185 spec+: {1186 endpoints: [1187 {1188 port: 'https',1189 scheme: 'https',1190 honorLabels: true,1191 bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',1192 tlsConfig: {1193 insecureSkipVerify: true,1194 },1195 },1196 ]1197 },1198 },1199 clusterRole+: {1200 rules+: [1201 {1202 apiGroups: ['authentication.k8s.io'],1203 resources: ['tokenreviews'],1204 verbs: ['create'],1205 },1206 {1207 apiGroups: ['authorization.k8s.io'],1208 resources: ['subjectaccessreviews'],1209 verbs: ['create'],1210 },1211 ],1212 },1213 }1214 },1215 foo: std.manifestJsonEx(self.bar, " ")1216}1217```1218</details>12191220| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1221|:---|---:|---:|---:|---:|1222| `Rust` | 1.7 ± 0.1 | 1.4 | 2.7 | 1.00 |1223| `Rust (alternative, rsjsonnet)` | 2.9 ± 0.1 | 2.7 | 3.3 | 1.73 ± 0.13 |1224| `Go` | 3.2 ± 0.1 | 2.7 | 3.8 | 1.92 ± 0.15 |1225| `Scala` | 294.7 ± 1.7 | 291.6 | 299.0 | 175.84 ± 12.30 |1226| `C++` | 101.4 ± 0.8 | 99.3 | 102.9 | 60.48 ± 4.24 |12271228### std.manifestTomlEx12291230> Note: No results for Scala, std.manifestTomlEx is not implemented: https://github.com/databricks/sjsonnet/issues/11112311232<details>1233<summary>Source</summary>12341235```jsonnet1236{1237 bar: {1238 prometheusOperator+: {1239 service+: {1240 spec+: {1241 ports: [1242 {1243 name: 'https',1244 port: 8443,1245 targetPort: 'https',1246 },1247 ],1248 },1249 },1250 serviceMonitor+: {1251 spec+: {1252 endpoints: [1253 {1254 port: 'https',1255 scheme: 'https',1256 honorLabels: true,1257 bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',1258 tlsConfig: {1259 insecureSkipVerify: true,1260 },1261 },1262 ],1263 },1264 },1265 clusterRole+: {1266 rules+: [1267 {1268 apiGroups: ['authentication.k8s.io'],1269 resources: ['tokenreviews'],1270 verbs: ['create'],1271 },1272 {1273 apiGroups: ['authorization.k8s.io'],1274 resources: ['subjectaccessreviews'],1275 verbs: ['create'],1276 },1277 ],1278 },1279 },1280 },1281 nothing: std.manifestTomlEx(self.bar, ' '),1282}12831284```1285</details>12861287| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1288|:---|---:|---:|---:|---:|1289| `Rust` | 1.7 ± 0.1 | 1.4 | 2.7 | 1.00 |1290| `Rust (alternative, rsjsonnet)` | 7.8 ± 0.2 | 7.3 | 8.5 | 4.65 ± 0.36 |1291| `Go` | 3.2 ± 0.1 | 2.9 | 3.7 | 1.90 ± 0.16 |1292| `C++` | 1046.1 ± 4.9 | 1039.7 | 1053.9 | 622.36 ± 44.25 |12931294### std.parseInt12951296<details>1297<summary>Source</summary>12981299```jsonnet1300{1301 foo: [1302 std.parseInt("-123949595") for i in std.range(0,100)1303 ],1304}1305```1306</details>13071308| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1309|:---|---:|---:|---:|---:|1310| `Rust` | 1.7 ± 0.1 | 1.4 | 2.6 | 1.00 |1311| `Rust (alternative, rsjsonnet)` | 2.9 ± 0.1 | 2.6 | 3.4 | 1.71 ± 0.16 |1312| `Go` | 2.8 ± 0.1 | 2.4 | 3.3 | 1.64 ± 0.16 |1313| `Scala` | 292.7 ± 1.7 | 289.2 | 295.8 | 170.68 ± 14.76 |1314| `C++` | 101.0 ± 0.7 | 99.0 | 102.0 | 58.88 ± 5.10 |13151316### std.reverse13171318<details>1319<summary>Source</summary>13201321```jsonnet1322{1323 foo: [1324 std.reverse(std.range(0, 5000)) for i in std.range(0,100)1325 ],1326}1327```1328</details>13291330| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1331|:---|---:|---:|---:|---:|1332| `Rust` | 45.3 ± 0.5 | 44.0 | 46.5 | 1.00 |1333| `Rust (alternative, rsjsonnet)` | 784.1 ± 20.4 | 741.5 | 802.0 | 17.31 ± 0.49 |1334| `Go` | 327.4 ± 2.1 | 323.8 | 331.4 | 7.23 ± 0.10 |1335| `Scala` | 367.0 ± 2.4 | 361.1 | 370.2 | 8.10 ± 0.11 |1336| `C++` | 659.3 ± 5.4 | 644.6 | 666.0 | 14.55 ± 0.21 |13371338### std.substr13391340<details>1341<summary>Source</summary>13421343```jsonnet1344{1345 foo: [1346 std.substr("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sed turpis tincidunt id aliquet risus. Eget mauris pharetra et ultrices neque ornare aenean euismod. Diam quis enim lobortis scelerisque fermentum. Varius duis at consectetur lorem donec massa sapien. Diam sit amet nisl suscipit adipiscing bibendum est ultricies integer. Lectus urna duis convallis convallis tellus. Nibh ipsum consequat nisl vel pretium lectus quam id leo. Feugiat in ante metus dictum at tempor commodo. Velit dignissim sodales ut eu sem integer. Dictum sit amet justo donec. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. ", i, 800-i) for i in std.range(0,100)1347 ],1348}1349```1350</details>13511352| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1353|:---|---:|---:|---:|---:|1354| `Rust` | 2.2 ± 0.2 | 1.9 | 3.2 | 1.00 |1355| `Rust (alternative, rsjsonnet)` | 3.2 ± 0.1 | 3.1 | 3.6 | 1.49 ± 0.11 |1356| `Go` | 6.8 ± 0.2 | 6.3 | 7.4 | 3.12 ± 0.24 |1357| `Scala` | 303.6 ± 3.6 | 300.5 | 318.2 | 139.43 ± 9.76 |1358| `C++` | 29.1 ± 0.4 | 28.3 | 30.2 | 13.36 ± 0.94 |13591360### Comparsion for array13611362> Note: No results for Scala, array comparsion is not implemented13631364<details>1365<summary>Source</summary>13661367```jsonnet1368local long_array = std.range(1, 1000000);1369long_array + [1] < long_array + [2]13701371```1372</details>13731374| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1375|:---|---:|---:|---:|---:|1376| `Rust` | 25.7 ± 0.2 | 25.0 | 26.0 | 1.00 |1377| `Rust (alternative, rsjsonnet)` | 228.1 ± 7.9 | 214.0 | 245.1 | 8.89 ± 0.31 |1378| `Go` | 150.4 ± 10.4 | 135.9 | 169.4 | 5.86 ± 0.41 |1379| `C++` | 125755.8 ± 989.6 | 123095.8 | 127475.4 | 4901.85 ± 49.12 |13801381### Comparsion for primitives13821383> Note: No results for C++, can't run: uses up to 192GB of RAM13841385<details>1386<summary>Source</summary>13871388```jsonnet1389([ i < j for i in std.range(1, 1000) for j in std.range(1, 1000)])13901391```1392</details>13931394| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |1395|:---|---:|---:|---:|---:|1396| `Rust` | 385.9 ± 4.2 | 372.4 | 391.5 | 1.00 |1397| `Rust (alternative, rsjsonnet)` | 1287.4 ± 27.0 | 1244.2 | 1335.1 | 3.34 ± 0.08 |1398| `Go` | 1817.1 ± 18.6 | 1779.7 | 1842.9 | 4.71 ± 0.07 |1399| `Scala` | 453.1 ± 3.9 | 448.1 | 462.2 | 1.17 ± 0.02 |flake.nixdiffbeforeafterboth--- a/flake.nix
+++ b/flake.nix
@@ -39,6 +39,7 @@
jsonnet = pkgs.callPackage ./nix/jsonnet.nix {};
# I didn't managed to build it, and nixpkgs version is marked as broken
# haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };
+ rsjsonnet = pkgs.callPackage ./nix/rsjsonnet.nix {};
jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {
inherit craneLib;
@@ -60,55 +61,55 @@
};
benchmarks = pkgs.callPackage ./nix/benchmarks.nix {
- inherit go-jsonnet sjsonnet jsonnet;
+ inherit go-jsonnet sjsonnet jsonnet rsjsonnet;
jrsonnetVariants = [
{
- drv = jrsonnet.overrideAttrs {forBenchmarks = true;};
+ drv = jrsonnet.override {forBenchmarks = true;};
name = "";
}
];
};
benchmarks-quick = pkgs.callPackage ./nix/benchmarks.nix {
- inherit go-jsonnet sjsonnet jsonnet;
+ inherit go-jsonnet sjsonnet jsonnet rsjsonnet;
quick = true;
jrsonnetVariants = [
{
- drv = jrsonnet.overrideAttrs {forBenchmarks = true;};
+ drv = jrsonnet.override {forBenchmarks = true;};
name = "";
}
];
};
benchmarks-against-release = pkgs.callPackage ./nix/benchmarks.nix {
- inherit go-jsonnet sjsonnet jsonnet;
+ inherit go-jsonnet sjsonnet jsonnet rsjsonnet;
jrsonnetVariants = [
{
- drv = jrsonnet.overrideAttrs {forBenchmarks = true;};
+ drv = jrsonnet.override {forBenchmarks = true;};
name = "current";
}
{
- drv = jrsonnet-nightly.overrideAttrs {forBenchmarks = true;};
+ drv = jrsonnet-nightly.override {forBenchmarks = true;};
name = "current-nightly";
}
{
- drv = jrsonnet-release.overrideAttrs {forBenchmarks = true;};
+ drv = jrsonnet-release.override {forBenchmarks = true;};
name = "release";
}
];
};
benchmarks-quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {
- inherit go-jsonnet sjsonnet jsonnet;
+ inherit go-jsonnet sjsonnet jsonnet rsjsonnet;
quick = true;
jrsonnetVariants = [
{
- drv = jrsonnet;
+ drv = jrsonnet.override {forBenchmarks = true;};
name = "current";
}
{
- drv = jrsonnet-nightly;
+ drv = jrsonnet-nightly.override {forBenchmarks = true;};
name = "current-nightly";
}
{
- drv = jrsonnet-release;
+ drv = jrsonnet-release.override {forBenchmarks = true;};
name = "release";
}
];
nix/benchmarks.nixdiffbeforeafterboth--- a/nix/benchmarks.nix
+++ b/nix/benchmarks.nix
@@ -1,86 +1,101 @@
-{ lib
-, runCommand
-, jsonnet-bundler
-, cacert
-, stdenv
-, fetchFromGitHub
-, go-jsonnet
-, sjsonnet
-, jsonnet
-, hyperfine
-, quick ? false
-, jrsonnetVariants
+{
+ lib,
+ runCommand,
+ jsonnet-bundler,
+ cacert,
+ stdenv,
+ fetchFromGitHub,
+ go-jsonnet,
+ sjsonnet,
+ jsonnet,
+ rsjsonnet,
+ hyperfine,
+ quick ? false,
+ jrsonnetVariants,
}:
-
-with lib;
-
-let
+with lib; let
jsonnetBench = fetchFromGitHub {
rev = "v0.19.1";
owner = "google";
repo = "jsonnet";
hash = "sha256-q1MNdbyrx4vvN5woe0o90pPqaNtsZjI5RQ7KJt7rOpU=";
};
- goJsonnetBench = (fetchFromGitHub {
- owner = "google";
- repo = "go-jsonnet";
- rev = "v0.19.1";
- hash = "sha256-FgQYnas0qkIedRAA8ApZXLzEylg6PS6+8zzl7j+yOeI=";
- }) + "/builtin-benchmarks";
+ goJsonnetBench =
+ (fetchFromGitHub {
+ owner = "google";
+ repo = "go-jsonnet";
+ rev = "v0.19.1";
+ hash = "sha256-FgQYnas0qkIedRAA8ApZXLzEylg6PS6+8zzl7j+yOeI=";
+ })
+ + "/builtin-benchmarks";
graalvmBench = fetchFromGitHub {
owner = "oracle";
repo = "graal";
rev = "bc305df3fe587960f7635f0185571500e5988475";
hash = "sha256-4EKB1b2o4/qtYQ+nqbbs621OJrtjApsAWEBcw5EjrYc=";
};
- kubePrometheusBench =
- let
- src = fetchFromGitHub {
- owner = "prometheus-operator";
- repo = "kube-prometheus";
- rev = "d3889807798d1697ea0691f10caf1b6a1997a8bd";
- hash = "sha256-TeYWHzoZAmDp2PzT7EH8XRUcvb3tR8Qfxel7o2QBvIM=";
- };
- in
+ kubePrometheusBench = let
+ src = fetchFromGitHub {
+ owner = "prometheus-operator";
+ repo = "kube-prometheus";
+ rev = "d3889807798d1697ea0691f10caf1b6a1997a8bd";
+ hash = "sha256-TeYWHzoZAmDp2PzT7EH8XRUcvb3tR8Qfxel7o2QBvIM=";
+ };
+ in
runCommand "kube-prometheus-vendor"
- {
- outputHash = "sha256-AGc0dHlD/Ld7I5b1+gOotzJkYrn+bB1VjISdD5NITtw=";
- outputHashMode = "recursive";
- buildInputs = [ cacert ];
- }
- ''
- mkdir -p $out
- cp -r ${src}/* $out/
- cd $out
- mkdir vendor
- ${jsonnet-bundler}/bin/jb install
- '';
+ {
+ outputHash = "sha256-AGc0dHlD/Ld7I5b1+gOotzJkYrn+bB1VjISdD5NITtw=";
+ outputHashMode = "recursive";
+ buildInputs = [cacert];
+ }
+ ''
+ mkdir -p $out
+ cp -r ${src}/* $out/
+ cd $out
+ mkdir vendor
+ ${jsonnet-bundler}/bin/jb install
+ '';
# Removes outsiders from the output
# Useful when comparing performance of different jrsonnet releases
- skipSlow = if quick then "slow benchmark, but only quick requested" else "";
+ skipSlow =
+ if quick
+ then "slow benchmark, but only quick requested"
+ else "";
in
-stdenv.mkDerivation {
- name = "benchmarks";
- __impure = true;
- unpackPhase = "true";
+ stdenv.mkDerivation {
+ name = "benchmarks";
+ __impure = true;
+ unpackPhase = "true";
- buildInputs = [
- go-jsonnet
- sjsonnet
- jsonnet
+ buildInputs = [
+ sjsonnet
+ jsonnet
+ rsjsonnet
+ go-jsonnet
- hyperfine
- ];
+ hyperfine
+ ];
- installPhase =
- let
- mkBench = { name, path, omitSource ? false, pathIsGenerator ? false, skipScala ? "", skipCpp ? "", skipGo ? "", vendor ? "" }: ''
- set -oux
-
+ installPhase = let
+ mkBench = {
+ name,
+ path,
+ omitSource ? false,
+ pathIsGenerator ? false,
+ skipRustAlternative ? "",
+ skipScala ? "",
+ skipCpp ? "",
+ skipGo ? "",
+ vendor ? "",
+ }: ''
echo >> $out
echo "### ${name}" >> $out
echo >> $out
+ ${optionalString (skipRustAlternative != "") ''
+ echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out
+ echo >> $out
+ ''}
${optionalString (skipGo != "") ''
echo "> Note: No results for Go, ${skipGo}" >> $out
echo >> $out
@@ -111,16 +126,25 @@
path=generated.jsonnet
''}
hyperfine -N -w4 -m20 --output=pipe --style=basic --export-markdown result.md \
- ${concatStringsSep " " (forEach jrsonnetVariants (variant:
- "\"${variant.drv}/bin/jrsonnet $path ${optionalString (vendor != "") "-J${vendor}"}\" -n \"Rust${if variant.name != "" then " (${variant.name})" else ""}\""
- ))} \
- ${optionalString (skipGo == "") "\"go-jsonnet $path ${optionalString (vendor != "") "-J ${vendor}"}\" -n \"Go\""} \
- ${optionalString (skipScala == "") "\"sjsonnet $path ${optionalString (vendor != "") "-J ${vendor}"}\" -n \"Scala\""} \
- ${optionalString (skipCpp == "") "\"jsonnet $path ${optionalString (vendor != "") "-J ${vendor}"}\" -n \"C++\""}
+ ${concatStringsSep " " (forEach jrsonnetVariants (
+ variant: "\"${variant.drv}/bin/jrsonnet $path${optionalString (vendor != "") " -J${vendor}"}\" -n \"Rust${
+ if variant.name != ""
+ then " (${variant.name})"
+ else ""
+ }\""
+ ))} \
+ ${optionalString (skipRustAlternative == "") "\"rsjsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Rust (alternative, rsjsonnet)\""} \
+ ${optionalString (skipGo == "") "\"go-jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Go\""} \
+ ${optionalString (skipScala == "") "\"sjsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala\""} \
+ ${optionalString (skipCpp == "") "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""}
cat result.md >> $out
'';
- in
- ''
+ in ''
+ set -oux
+
+ temp=$(mktemp -d)
+ cd $temp
+
touch $out
${optionalString (!quick) ''
cat ${./benchmarks.md} >> $out
@@ -149,45 +173,200 @@
echo >> $out
echo "</details>" >> $out
echo >> $out
+ echo "Rust (alternative):" >> $out
+ echo >> $out
+ echo "\`\`\`" >> $out
+ rsjsonnet --help 2>> $out || true
+ echo "\`\`\`" >> $out
+ echo >> $out
+ echo "</details>" >> $out
+ echo >> $out
echo >> $out
''}
echo "## Real world" >> $out
- ${mkBench {name = "Graalvm CI"; path = "${graalvmBench}/ci.jsonnet"; skipCpp = "takes longer than a hour"; skipGo = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "Kube-prometheus manifests"; vendor = "${kubePrometheusBench}/vendor"; path = "${kubePrometheusBench}/example.jsonnet"; skipCpp = skipSlow; skipGo = skipSlow; skipScala = skipSlow;}}
+ ${mkBench {
+ name = "Graalvm CI";
+ path = "${graalvmBench}/ci.jsonnet";
+ skipCpp = "takes longer than a hour";
+ skipGo = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Kube-prometheus manifests";
+ vendor = "${kubePrometheusBench}/vendor";
+ path = "${kubePrometheusBench}/example.jsonnet";
+ skipCpp = skipSlow;
+ skipGo = skipSlow;
+ skipScala = skipSlow;
+ }}
echo >> $out
echo "## Benchmarks from C++ jsonnet (/perf_tests)" >> $out
- ${mkBench {name = "Large string join"; path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet"; skipScala = skipSlow;}}
- ${mkBench {name = "Large string template"; omitSource = true; path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet"; skipGo = "fails with os stack size exhausion"; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "Realistic 1"; path = "${jsonnetBench}/perf_tests/realistic1.jsonnet"; skipGo = skipSlow; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "Realistic 2"; path = "${jsonnetBench}/perf_tests/realistic2.jsonnet"; skipGo = skipSlow; skipCpp = skipSlow; skipScala = skipSlow;}}
+ ${mkBench {
+ name = "Large string join";
+ path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Large string template";
+ omitSource = true;
+ path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";
+ skipGo = "fails with os stack size exhausion";
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Realistic 1";
+ path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";
+ skipGo = skipSlow;
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Realistic 2";
+ path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";
+ skipGo = skipSlow;
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
echo >> $out
echo "## Benchmarks from C++ jsonnet (/benchmarks)" >> $out
- ${mkBench {name = "Tail call"; path = "${jsonnetBench}/benchmarks/bench.01.jsonnet"; skipScala = skipSlow;}}
- ${mkBench {name = "Inheritance recursion"; path = "${jsonnetBench}/benchmarks/bench.02.jsonnet"; skipCpp = skipSlow; skipGo = skipSlow;}}
- ${mkBench {name = "Simple recursive call"; path = "${jsonnetBench}/benchmarks/bench.03.jsonnet"; skipScala = skipSlow; skipGo = skipSlow;}}
- ${mkBench {name = "Foldl string concat"; path = "${jsonnetBench}/benchmarks/bench.04.jsonnet"; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "Array sorts"; path = "${jsonnetBench}/benchmarks/bench.06.jsonnet"; skipScala = "std.reverse is not implemented"; skipCpp = skipSlow;}}
- ${mkBench {name = "Lazy array"; path = "${jsonnetBench}/benchmarks/bench.07.jsonnet"; skipGo = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "Inheritance function recursion"; path = "${jsonnetBench}/benchmarks/bench.08.jsonnet"; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "String strips"; path = "${jsonnetBench}/benchmarks/bench.09.jsonnet"; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "Big object"; path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet"; pathIsGenerator = true; skipScala = skipSlow;}}
+ ${mkBench {
+ name = "Tail call";
+ path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Inheritance recursion";
+ path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";
+ skipCpp = skipSlow;
+ skipGo = skipSlow;
+ }}
+ ${mkBench {
+ name = "Simple recursive call";
+ path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";
+ skipScala = skipSlow;
+ skipGo = skipSlow;
+ }}
+ ${mkBench {
+ name = "Foldl string concat";
+ path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Array sorts";
+ path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";
+ skipCpp = skipSlow;
+ # std.assertEqual(reverse(std.range(1, 1000)), sort(std.range(1, 1000), keyF=function(x) -x))
+ skipScala = "sjsonnet doesn't support keyF in std.sort: https://github.com/databricks/sjsonnet/issues/204";
+ }}
+ ${mkBench {
+ name = "Lazy array";
+ path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";
+ skipGo = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Inheritance function recursion";
+ path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "String strips";
+ path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Big object";
+ path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";
+ pathIsGenerator = true;
+ skipScala = skipSlow;
+ }}
echo >> $out
echo "## Benchmarks from Go jsonnet (builtins)" >> $out
- ${mkBench {name = "std.base64"; path = "${goJsonnetBench}/base64.jsonnet"; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "std.base64Decode"; path = "${goJsonnetBench}/base64Decode.jsonnet"; skipCpp = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "std.base64DecodeBytes"; path = "${goJsonnetBench}/base64DecodeBytes.jsonnet"; skipCpp = skipSlow; skipGo = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "std.base64 (byte array)"; path = "${goJsonnetBench}/base64_byte_array.jsonnet"; skipCpp = skipSlow; skipGo = skipSlow; skipScala = skipSlow;}}
- ${mkBench {name = "std.foldl"; path = "${goJsonnetBench}/foldl.jsonnet"; skipScala = skipSlow;}}
- ${mkBench {name = "std.manifestJsonEx"; path = "${goJsonnetBench}/manifestJsonEx.jsonnet"; skipScala = skipSlow; skipCpp = skipSlow;}}
- ${mkBench {name = "std.manifestTomlEx"; path = "${goJsonnetBench}/manifestTomlEx.jsonnet"; skipScala = "std.manifestTomlEx is not implemented"; skipCpp=skipSlow;}}
- ${mkBench {name = "std.parseInt"; path = "${goJsonnetBench}/parseInt.jsonnet"; skipScala = skipSlow; skipCpp = skipSlow;}}
- ${mkBench {name = "std.reverse"; path = "${goJsonnetBench}/reverse.jsonnet"; skipScala = "std.reverse is not implemented"; skipCpp = skipSlow; skipGo = skipSlow;}}
- ${mkBench {name = "std.substr"; path = "${goJsonnetBench}/substr.jsonnet"; skipScala = skipSlow;}}
- ${mkBench {name = "Comparsion for array"; path = "${goJsonnetBench}/comparison.jsonnet"; skipScala = "array comparsion is not implemented"; skipCpp = skipSlow;}}
- ${mkBench {name = "Comparsion for primitives"; path = "${goJsonnetBench}/comparison2.jsonnet"; skipCpp = "can't run: uses up to 192GB of RAM"; skipGo = skipSlow; skipScala = skipSlow;}}
+ ${mkBench {
+ name = "std.base64";
+ path = "${goJsonnetBench}/base64.jsonnet";
+ skipRustAlternative = skipSlow;
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.base64Decode";
+ path = "${goJsonnetBench}/base64Decode.jsonnet";
+ skipRustAlternative = skipSlow;
+ skipCpp = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.base64DecodeBytes";
+ path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";
+ skipRustAlternative = skipSlow;
+ skipCpp = skipSlow;
+ skipGo = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.base64 (byte array)";
+ path = "${goJsonnetBench}/base64_byte_array.jsonnet";
+ skipRustAlternative = skipSlow;
+ skipCpp = skipSlow;
+ skipGo = skipSlow;
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.foldl";
+ path = "${goJsonnetBench}/foldl.jsonnet";
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.manifestJsonEx";
+ path = "${goJsonnetBench}/manifestJsonEx.jsonnet";
+ skipScala = skipSlow;
+ skipCpp = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.manifestTomlEx";
+ path = "${goJsonnetBench}/manifestTomlEx.jsonnet";
+ skipScala = "std.manifestTomlEx is not implemented: https://github.com/databricks/sjsonnet/issues/111";
+ skipCpp = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.parseInt";
+ path = "${goJsonnetBench}/parseInt.jsonnet";
+ skipScala = skipSlow;
+ skipCpp = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.reverse";
+ path = "${goJsonnetBench}/reverse.jsonnet";
+ skipCpp = skipSlow;
+ skipGo = skipSlow;
+ }}
+ ${mkBench {
+ name = "std.substr";
+ path = "${goJsonnetBench}/substr.jsonnet";
+ skipScala = skipSlow;
+ }}
+ ${mkBench {
+ name = "Comparsion for array";
+ path = "${goJsonnetBench}/comparison.jsonnet";
+ skipScala = "array comparsion is not implemented";
+ skipCpp = skipSlow;
+ }}
+ ${mkBench {
+ name = "Comparsion for primitives";
+ path = "${goJsonnetBench}/comparison2.jsonnet";
+ skipRustAlternative = skipSlow;
+ skipCpp = "can't run: uses up to 192GB of RAM";
+ skipGo = skipSlow;
+ skipScala = skipSlow;
+ }}
'';
-}
+ }
nix/go-jsonnet.nixdiffbeforeafterboth--- a/nix/go-jsonnet.nix
+++ b/nix/go-jsonnet.nix
@@ -1,6 +1,9 @@
-{ lib, buildGo119Module, fetchFromGitHub, makeWrapper }:
-
-buildGo119Module rec {
+{
+ buildGoModule,
+ fetchFromGitHub,
+ makeWrapper,
+}:
+buildGoModule rec {
pname = "go-jsonnet";
version = "0.20.0";
@@ -12,7 +15,7 @@
};
vendorHash = "sha256-j1fTOUpLx34TgzW94A/BctLrg9XoTtb3cBizhVJoEEI=";
- buildInputs = [ makeWrapper ];
+ buildInputs = [makeWrapper];
postInstall = ''
mv $out/bin/jsonnet $out/bin/go-jsonnet
@@ -21,5 +24,5 @@
doCheck = false;
- subPackages = [ "cmd/jsonnet" ];
+ subPackages = ["cmd/jsonnet"];
}
nix/jsonnet.nixdiffbeforeafterboth--- a/nix/jsonnet.nix
+++ b/nix/jsonnet.nix
@@ -1,5 +1,8 @@
-{ stdenv, lib, jekyll, fetchFromGitHub, makeWrapper }:
-
+{
+ stdenv,
+ fetchFromGitHub,
+ makeWrapper,
+}:
stdenv.mkDerivation rec {
pname = "jsonnet";
version = "0.20.0";
@@ -15,7 +18,7 @@
"jsonnet"
];
- nativeBuildInputs = [ makeWrapper ];
+ nativeBuildInputs = [makeWrapper];
installPhase = ''
mkdir -p $out/bin
nix/rsjsonnet.nixdiffbeforeafterboth--- /dev/null
+++ b/nix/rsjsonnet.nix
@@ -0,0 +1,24 @@
+{
+ fetchFromGitHub,
+ rustPlatform,
+ makeWrapper,
+}:
+rustPlatform.buildRustPackage rec {
+ pname = "rsjsonnet";
+ version = "0.1.1";
+
+ src = fetchFromGitHub {
+ owner = "eduardosm";
+ repo = pname;
+ rev = "v${version}";
+ hash = "sha256-C6hZYGllKrKKMwMwss6PK2UD5Zb7bk2v8DrGpWnwP/A=";
+ };
+
+ cargoHash = "sha256-TsUN9oUu6S1l9oTaR6nET1ZdRvMrR29bkP3VEDre8aE=";
+
+ nativeBuildInputs = [makeWrapper];
+
+ postInstall = ''
+ wrapProgram $out/bin/rsjsonnet --add-flags "--max-stack=200000"
+ '';
+}
nix/sjsonnet.nixdiffbeforeafterboth--- a/nix/sjsonnet.nix
+++ b/nix/sjsonnet.nix
@@ -1,30 +1,30 @@
# This derivation uses released sjsonnet binary, which most users will use
-
# However, recommended way of using sjsonnet - is using a client-server model,
# for which there is no released binaries: https://github.com/databricks/sjsonnet/issues/51
-
# TODO: Somehow build client-server version of sjsonnet, and use it in benchmarks
-
-{ stdenv, lib, fetchurl, jdk20, makeWrapper }:
-
+{
+ stdenv,
+ fetchurl,
+ jdk21_headless,
+ makeWrapper,
+ java ? jdk21_headless,
+}:
stdenv.mkDerivation rec {
pname = "sjsonnet";
- version = "0.4.6";
+ version = "0.4.10";
src = fetchurl {
- url =
- "https://github.com/databricks/${pname}/releases/download/${version}/${pname}-${version}.jar";
- hash = "sha256-ivVKMf7W9iLF/KSXYEl6iJeNGEP5jxw2uqPF7pz6rBU=";
+ url = "https://github.com/databricks/${pname}/releases/download/${version}/${pname}-${version}.jar";
+ hash = "sha256-zKlmh+jXm23x78CKwna8fGHNqziWuPipSbWTPUCADrY=";
};
unpackPhase = "true";
- buildInputs =
- [ jdk20 makeWrapper ];
+ buildInputs = [java makeWrapper];
installPhase = ''
mkdir -p $out/bin $out/lib
cp $src $out/lib/sjsonnet.jar
- makeWrapper ${jdk20}/bin/java $out/bin/sjsonnet --add-flags "-Xss100m -XX:+UseStringDeduplication -jar $out/lib/sjsonnet.jar"
+ makeWrapper ${java}/bin/java $out/bin/sjsonnet --add-flags "-Xss100m -XX:+UseStringDeduplication -jar $out/lib/sjsonnet.jar"
'';
separateDebugInfo = false;
}