There are multiple implementations of jsonnet implemented in different languages: Rust (this repo), Go, Scala, C++, Haskell.
For simplicity, I will call these implementations by the language of their implementation.
Unfortunately, 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 benchmarks
CPU: AMD Ryzen 9 9950X3D 16-Core Processor, 32 threads
Tested versions
-
Go: Jsonnet commandline interpreter (Go implementation) v0.22.0-rc1
-
C++: Jsonnet commandline interpreter v0.22.0-rc1
-
Scala (native/GraalVM): Sjsonnet 0.6.3
-
Rust (alternative): rsjsonnet 2026-03-23 (27be31532180c611383ceb2b7f03193ab1253487)
-
Rust (current): jrsonnet 0.5.0-pre98
-
Rust (current-experimental): jrsonnet 0.5.0-pre98
-
Rust (release): jrsonnet 0.5.0-pre96
Real world
Graalvm CI
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, takes longer than a hour
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
32.5 ± 1.7 |
28.6 |
38.0 |
1.01 ± 0.07 |
|
32.1 ± 1.3 |
29.1 |
35.4 |
1.00 |
|
49.0 ± 3.0 |
42.9 |
54.7 |
1.52 ± 0.11 |
|
69.0 ± 8.3 |
54.8 |
85.9 |
2.15 ± 0.27 |
|
72.6 ± 4.5 |
60.6 |
82.5 |
2.26 ± 0.17 |
|
66.0 ± 2.4 |
58.6 |
69.6 |
2.05 ± 0.11 |
Kube-prometheus manifests
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, too slow, takes hours, skews results
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
56.7 ± 4.0 |
49.5 |
69.3 |
1.00 |
|
57.0 ± 3.0 |
51.6 |
69.1 |
1.01 ± 0.09 |
|
70.2 ± 3.2 |
66.3 |
85.0 |
1.24 ± 0.10 |
|
61.5 ± 4.1 |
51.9 |
73.9 |
1.08 ± 0.10 |
|
216.9 ± 4.4 |
210.5 |
228.5 |
3.82 ± 0.28 |
|
195.4 ± 9.7 |
181.5 |
216.0 |
3.45 ± 0.29 |
Benchmarks from C++ jsonnet (/perf_tests)
Large string join
Source
{
text: std.join(',', std.makeArray(76846, function(_) 'x')),
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
5.7 ± 0.4 |
5.1 |
7.6 |
2.11 ± 0.23 |
|
6.3 ± 0.4 |
5.7 |
8.2 |
2.32 ± 0.25 |
|
2.7 ± 0.2 |
2.4 |
3.8 |
1.00 |
|
12.8 ± 2.0 |
10.1 |
20.6 |
4.70 ± 0.85 |
|
45.4 ± 1.9 |
41.8 |
49.5 |
16.71 ± 1.65 |
|
10.1 ± 1.0 |
8.0 |
14.0 |
3.70 ± 0.51 |
|
8.1 ± 0.6 |
6.5 |
10.0 |
2.96 ± 0.33 |
|
39.5 ± 3.0 |
33.4 |
47.1 |
14.51 ± 1.71 |
Large string template
Note: No results for Go, fails with os stack size exhausion
Note: No results for C++, too slow, takes hours, skews results
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
2.2 ± 0.3 |
1.9 |
4.0 |
1.00 ± 0.15 |
|
2.2 ± 0.2 |
2.0 |
3.3 |
1.00 |
|
2.8 ± 0.2 |
2.5 |
4.2 |
1.26 ± 0.15 |
|
3.5 ± 0.4 |
3.0 |
5.7 |
1.57 ± 0.22 |
|
14.3 ± 1.0 |
12.2 |
17.6 |
6.43 ± 0.73 |
|
14.2 ± 0.8 |
11.8 |
16.0 |
6.37 ± 0.65 |
Realistic 1
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, too slow, takes hours, skews results
Source
local utils = {
Func3(aaaaaaa, bbbbbbb, cccc)::
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/%s/XXXXX/%s/XXXXXXXXXXXXXXX/%s'
% [aaaaaaa, bbbbbbb, cccc],
};
local long_list = [
'001xxxxxxxxxxxxxxx-xxx',
'002xxxxxxxxxxxxxxxxxx-xxx',
'003xxxxxxxxxxxxxxxx-xxxxxxx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x-xxxxxxxxxxx-xxxxxxx',
'101xxx-xxxx-xxxxxxxxxxxxxxxx',
'102xxx-xxx-xxxxxxxxxxxxxxxxxx',
'103xxx-xxx-xxxxxxxx-xxxxxxxxxxxx-xxx',
'104xxx-xxx-xxxx-xxxxxxx',
'105xxx-xxx-xxx-xxxxxxx-xxxxxx-xxxxxxx',
'106xxx-xxx-xxx-xxxx-xxxx-xxx-xxxxxxxxx',
'107xxx-xxx-xxxxxxxxx',
'108xxx-xxx-xxx-xxxxxxx',
'109xxx-xxx-xxx-xxxxxxx',
'110xxx-xxxx-xxxxx',
'111xxx-xxx-xxx-xxxx-xxxx',
'112xxx-xxx-xxx-xxxxxxx',
'113xxx-xxx-xxx-xxxxxxx',
'114xxx-xxx-xxxxxxxxxxxx-xxxxxxx',
'115xxx-xxx-xxx-xxxx-xxxx',
'116xxx-xxx-xxx-xxxxxxxx-xxxxxxxx',
'117xxx-xxx-xxxxxxx',
'118xxx-xxx-xxxxxxxx-xxxxxxx',
'119xxx-xxx-xxxxxx',
'120xxxx-xxx-xxxxxxxxxx',
'121xxx-xxx-xxxxxx-xxxxxx-xxxxxxx',
'122xxx-xxx-xxxxxx-xxxxxxx',
'123xxx-xxx-xxxxxx-xx',
'124xxxx-xxx-xxx-xxxx-xxxxxxx',
'125xxx-xxx-xxxxxxxxxxx',
'126xxx-xxx-xxxxxxxxxxx-xxxxxxx',
'127xxx-xxx-xxxxxx-xxx-xxxxxx',
'128xxx-xxx-xxxxxxxxxx',
'129xxx-xxx-xxxxxxxxxx-xxx',
'130xxx-xxx-xxxxx-xxxxxxx',
'131xxx-xxx-xxxxxx-xxxxxxxx-xxx',
'132xxx-xxx-xxxxx-xxxxxxxx-xxxxxx',
'133xxx-xxx-xxxxx-xx',
'134xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxxx',
'135xxx-xxx-xxxx-xxxxxxx-xxx-xxxxxx',
'136xxx-xxx-xxxxxxxxxxxxxxx',
'137xxx-xxx-xxx',
'138xxx-xxx-xxxxxxx-xxxxxxx',
'139xxx-xxx-xxxxxxx-xxx-xxxxxxx',
'140xxx-xxx-xxxxxxxxx-xxxxxx-xxxxxxx',
'141xxx-xxx-xxxxxxxxxx-xxxx-xxxxxxx',
'142xxx-xxx-xx-xxxxxxxxxx-xxxxx',
'143xxx-xxx-xxxxxxxxxxxxxx-xxxxxxx',
'144xxx-xxx-xxxxxxxxxxxxxxxxx',
'145xxx-xxx-xxxxxxxx-xxxxxxx',
'146xxx-xxx-xxxxxxxxxxxxx-xxxxxxx',
'147xxx-xxx-xxxxxxx-xxxxxxx',
'148xxx-xxx-xxxxxx-xxxxxxx',
'149xxx-xxx-xxxxx-xxxxx',
'150xxx-xxx-xxxxx-xxxx',
'151xxx-xxx-xxxxxxxxxxxxxxxxx',
'152xxx-xxx-xxxxxxxxxxxxxxxxxxx',
'153xxx-xxx-xxxxxxxxx-xxxxx-xxx',
'154xxx-xxx-xxxxxxxx-xxxxx-xxxx-xxxx',
'155xxx-xxx-xxxxxxxx-xxxxxxxxxxxx-xxxx',
'156xxx-xxx-xxxxxxxx-xx-xxx-xxxxxxxx',
'157xxx-xxx-xxxxxxxx-xxxxxx-xxxxxxx',
'158xxx-xxx-xxxxxxxxxx',
'159xxx-xxx-xxxx-xxxxxx',
'160xxx-xxx-xxxxxxxxxx',
'161xxx-xxx-xxxxxxxxxxxxx',
'162xxx-xxx-xxxxxxxxxxxxxxxx',
'163xxx-xxx-xxxxx-xxxxxx-xxxxxxx',
'164xxx-xxx-xxxxxxx-xxxxxxxxxxxxx',
'165xxx-xxx-xxxxxxxxxxxxxx-xxxxxxx',
'166xxx-xxx-xxxxxxxxx-xxxxxxx-x2',
'167xxx-xxx-xxx',
'168xxx-xxx-xxxxxxxxxxxx',
'169xxx-xxx-xxxxxxxxx-xxxxxxxx',
'170xxx-xxx-xxxxxxxxx-xxx-xxxxxxx',
'171xxx-xxx-xxxxxxxxx',
'172xxx-xxxx-xxxxxxxxx',
'173xxx-xxx',
'174xxx-xxxxxx-xxxxxxx',
'175xxx-xxxxxx-xxxxxx-xxxx',
'176xxx-xxxxxx-xxxxx',
'177xxx-xxxxx-xxxxxxxx',
'178xxx-xxxxxx',
'179xxx-xxxxxxx-xxxx',
'180xxx-xxxxxxx-xxxx-xxxx',
'181xxx-xxxxxxx-xxxx-xxxxxxx',
'182xxx-xxxxxxx-xxxx-xxxxxxxxxxxxxxx',
'183xxx-xxxxxxxx-xxxx-xxxxx',
'184xxx-xxxxxxx-xxxx-xxxxxxx',
'185xxx-xxxxxxx-xxxx-xxxxxxxx-xxxxxxx',
'186xxx-xxxxxxx-xxxx-xxx',
'187xxx-xxxxxxx-xxxx-xxxxxxx-xxx-xxxxxxx',
'188xxx-xxxxxxx-xxxx-xxxxxxxxxxxxxx-xxxxxxx',
'189xxx-xxxxxxxx-xxxx-xxxxxxxxxxxxxxxxx',
'190xxx-xxxxxxx-xxxx-xxxxx-xxxxxx-xxxxxxx',
'191xxx-xxxxxxx-xxxxxxxxxx',
'192xxx-xxxxxxx-xxxxxxx',
'193xxx-xxxxxxx-xxxxxxxxxxxxxxx',
'194xxx-xxxxxxx-xxxxx',
'195xxx-xxxxxxx-xxxxxxx',
'196xxx-xxxxxxx-xxxxxxxx-xxxxxxx',
'197xxx-xxxxxxx-xxx',
'198xxx-xxxxxxx-xxxxxxx-xxx-xxxxxxx',
'199xxx-xxxxxxx-xxxxxxxxxxxxxx-xxxxxxx',
'200xxx-xxxxxxxx-xxxxxxxxxxxxxxxxx',
'201xxx-xxxxxxx-xxxxx-xxxxxx-xxxxxxx',
'202xxx-xxx',
'203xxx-xxx-xxxxxx',
'204xxxxxxxxx-xxx',
'205xxxxxxxxxxx-xxx',
'206xxxxxxxxx-xxxxxxx',
'207xxxx-xxxxxx-xxxxxxxxxxx-xxxxx1',
'208xxxx-xxxxxxxx-xxxxxxxx-xxxxx1',
'209xxxx-xxxxxxx-xxxxxxx-xxxxx1',
'209xxxx-xxxxxxx-xxxxxxx-xxxxx2',
'210xxxx-xxxx-xxxxxxx-xxxxx1',
'211xxxx-xxxxx-xxxxxxxx1-xxxxx1',
'212xxxx-xxxx-xxxxxxxx2-xxxxx1',
'213xxxx-xxxx-xxxxxxx1-xxxxx1',
'214xxxx-xxxx-xxxxxxx2-xxxxx1',
'215xxxxxxxxx-xxxxxx',
'216xxxxxxxxx-xxxxxxx',
'217xxxxxxxxx-xxxx',
];
{
'yyyyyyyyy': {
local Func3(z, n) = utils.Func3('yyyyyyyyy', z, n),
global: {
[n]: {
members: [
Func3(z, '%s-gggg-%s-%s' % [n, z, suffix]),
for z in ['ooooooo-a', 'ooooooo-b', 'ooooooo-c',
'ooooooo-a', 'ooooooo-b', 'ooooooo-c']
for suffix in ['a', 'b', 'c']
],
}
for n in long_list
},
},
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
6.0 ± 0.4 |
5.5 |
8.3 |
1.01 ± 0.08 |
|
5.9 ± 0.3 |
5.4 |
7.3 |
1.00 |
|
6.7 ± 0.3 |
6.2 |
7.9 |
1.13 ± 0.08 |
|
8.1 ± 0.6 |
7.3 |
10.2 |
1.37 ± 0.13 |
|
13.1 ± 1.1 |
10.5 |
16.8 |
2.22 ± 0.23 |
|
14.1 ± 0.8 |
11.9 |
16.1 |
2.39 ± 0.19 |
Realistic 2
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, too slow, takes hours, skews results
Source
local rfc3339(timestamp) = '1970-01-01T00:00:00Z';
local name1(a, b, c) =
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%sBBBBBBB%sCCCCCCCCCCC%s'
% [a, b, c];
local name2(x) =
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX%s' % x;
local T1 = 'PPPPPPPPPPPPPPPPPPPPPPP';
local T2 = 'QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ';
local LOCATIONS = [
'europe-west1-b',
'europe-west1-c',
'europe-west1-d',
'europe-west2-a',
'europe-west2-b',
'europe-west2-c',
'europe-west3-a',
'europe-west3-b',
'europe-west3-c',
'europe-west4-a',
'europe-west4-b',
'europe-west4-c',
'us-central1-a',
'us-central1-b',
'us-central1-c',
'us-central1-f',
'us-east1-b',
'us-east1-c',
'us-east1-d',
'us-east4-a',
'us-east4-b',
'us-east4-c',
'us-west1-a',
'us-west1-b',
'us-west1-c',
];
// The return value is a function to allow it to be parameterized.
function(
timestamp=0,
x='xxxxxxxxxxxxxxxxxxx',
prefix='prefix',
num1=50,
count=25,
offset=0,
)
local rfc_timestamp = rfc3339(timestamp);
local func1(i) =
local location = LOCATIONS[i % std.length(LOCATIONS)];
[
local name = '%s-%000d-%000d' % [prefix, i, j];
{
field_zz1: rfc_timestamp,
fie_z2: {
field_z3: name1(x, location, name),
field_zzzzzzzzzz4: name2(x),
field_zzz5: [name],
field_z6: T1,
field_z7: location,
fi_8: '???',
fiel_z9: '99',
},
}
for j in std.range(0, num1 - 1)
];
local func2(i) =
local location = LOCATIONS[i % std.length(LOCATIONS)];
local all = [
name1(x, location, '%s-%000d-%000d' % [prefix, i, j])
for j in std.range(0, num1 - 1)
];
[
{
field_yy1: rfc_timestamp,
field_yyyyy2: 'EEEE',
field_yyyyy3: {
field_y4: T2,
field_yyyyyyy5: p,
field_yyyyyyy6: q,
},
}
for p in all
for q in all
if p != q
];
{
field_x1: '-----',
field_xxxxxxxxxxxxxxxx2: std.join([], [
func1(offset * count + i)
for i in std.range(0, count - 1)
]),
field_xxxxxxxxxxxxxxxxxxxxxx3: std.join([], [
func2(offset * count + i)
for i in std.range(0, count - 1)
]),
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
218.8 ± 13.7 |
201.0 |
255.5 |
1.35 ± 0.10 |
|
221.2 ± 11.0 |
209.1 |
250.3 |
1.36 ± 0.08 |
|
162.5 ± 5.7 |
154.4 |
177.0 |
1.00 |
|
174.4 ± 6.2 |
164.3 |
186.2 |
1.07 ± 0.05 |
|
447.7 ± 17.4 |
426.0 |
485.3 |
2.76 ± 0.14 |
|
441.3 ± 16.4 |
420.3 |
479.1 |
2.72 ± 0.14 |
Benchmarks from C++ jsonnet (/benchmarks)
Tail call
Source
/*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
local sum(x) =
if x == 0 then
0
else
x + sum(x - 1);
sum(300)
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
891.3 ± 111.4 |
727.6 |
2682.4 |
1.03 ± 0.20 |
|
862.8 ± 124.7 |
715.8 |
1826.4 |
1.00 |
|
935.0 ± 97.7 |
769.7 |
1796.3 |
1.08 ± 0.19 |
|
1242.7 ± 160.8 |
1032.2 |
3444.5 |
1.44 ± 0.28 |
|
2720.3 ± 292.6 |
2099.6 |
4398.7 |
3.15 ± 0.57 |
|
2537.5 ± 389.6 |
2051.2 |
4220.6 |
2.94 ± 0.62 |
|
1733.0 ± 257.4 |
1385.8 |
3193.2 |
2.01 ± 0.42 |
|
19697.0 ± 1508.1 |
17390.4 |
25383.2 |
22.83 ± 3.73 |
Inheritance recursion
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, slow benchmark, but only quick requested
Source
/*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
local Fib = {
n: 1,
local outer = self,
r: if self.n <= 1 then 1 else (Fib { n: outer.n - 1 }).r + (Fib { n: outer.n - 2 }).r,
};
(Fib { n: 25 }).r
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
192.1 ± 6.2 |
180.6 |
204.7 |
3.88 ± 0.17 |
|
197.1 ± 8.0 |
183.2 |
212.7 |
3.98 ± 0.20 |
|
249.4 ± 10.5 |
227.2 |
270.4 |
5.04 ± 0.26 |
|
118.1 ± 1.8 |
115.9 |
124.3 |
2.39 ± 0.08 |
|
49.5 ± 1.5 |
47.4 |
55.5 |
1.00 |
|
62.6 ± 2.1 |
58.8 |
68.5 |
1.27 ± 0.06 |
Simple recursive call
Note: No results for Go, slow benchmark, but only quick requested
Source
/*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
local fibonacci(n) =
if n <= 1 then
1
else
fibonacci(n - 1) + fibonacci(n - 2);
fibonacci(25)
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
34.5 ± 0.6 |
33.3 |
36.0 |
1.81 ± 0.07 |
|
32.8 ± 0.7 |
31.7 |
35.0 |
1.73 ± 0.07 |
|
42.8 ± 0.8 |
41.8 |
45.2 |
2.25 ± 0.08 |
|
40.5 ± 1.2 |
38.9 |
44.6 |
2.13 ± 0.09 |
|
19.0 ± 0.6 |
17.6 |
20.4 |
1.00 |
|
33.5 ± 10.1 |
22.8 |
54.3 |
1.76 ± 0.54 |
|
149.7 ± 27.2 |
82.8 |
175.4 |
7.87 ± 1.45 |
Foldl string concat
Note: No results for C++, slow benchmark, but only quick requested
Source
std.foldl(function(e, res) e + res, std.makeArray(20000, function(i) 'aaaaa'), '')
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
7.2 ± 1.6 |
4.2 |
14.4 |
1.00 |
|
7.8 ± 1.5 |
4.4 |
12.4 |
1.08 ± 0.32 |
|
9.0 ± 1.4 |
5.1 |
12.9 |
1.25 ± 0.34 |
|
110.1 ± 13.4 |
96.0 |
143.0 |
15.29 ± 3.90 |
|
4386.8 ± 587.0 |
3827.3 |
5908.8 |
609.22 ± 158.87 |
|
438.7 ± 50.8 |
334.9 |
553.4 |
60.92 ± 15.35 |
|
572.3 ± 59.1 |
485.1 |
737.3 |
79.48 ± 19.59 |
Array sorts
Note: No results for C++, slow benchmark, but only quick requested
Source
// A benchmark for builtin sort
local reverse = std.reverse;
local sort = std.sort;
true
&& std.assertEqual(std.range(1, 500), sort(std.range(1, 500)))
&& std.assertEqual(std.range(1, 1000), sort(std.range(1, 1000)))
&& std.assertEqual(reverse(std.range(1, 1000)), sort(std.range(1, 1000), keyF=function(x) -x))
&& std.assertEqual(std.range(1, 1000), sort(reverse(std.range(1, 1000))))
&& std.assertEqual(std.makeArray(2000, function(i) std.floor((i + 2) / 2)), sort(std.range(1, 1000) + reverse(std.range(1, 1000))))
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
1.6 ± 0.3 |
1.4 |
3.9 |
1.02 ± 0.23 |
|
1.6 ± 0.3 |
1.3 |
3.8 |
1.00 |
|
1.7 ± 0.3 |
1.4 |
4.1 |
1.08 ± 0.24 |
|
3.6 ± 0.4 |
3.2 |
5.9 |
2.32 ± 0.45 |
|
6.0 ± 0.7 |
5.2 |
12.1 |
3.82 ± 0.78 |
|
4.5 ± 0.7 |
3.6 |
7.0 |
2.88 ± 0.63 |
|
3.1 ± 0.5 |
2.4 |
6.7 |
1.95 ± 0.47 |
Lazy array
Note: No results for Go, slow benchmark, but only quick requested
Source
local f2(f) = function(x) f(f(x));
local id(x) = x;
local slowId = std.makeArray(20, function(i) if i == 0 then id else f2(slowId[i - 1]));
slowId[15](42)
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
23.8 ± 2.3 |
16.5 |
29.2 |
2.07 ± 0.28 |
|
21.2 ± 2.4 |
14.4 |
27.0 |
1.84 ± 0.27 |
|
48.1 ± 3.6 |
41.5 |
57.3 |
4.18 ± 0.50 |
|
11.5 ± 1.1 |
9.8 |
15.0 |
1.00 |
|
27.2 ± 3.8 |
21.2 |
39.1 |
2.36 ± 0.40 |
|
25.7 ± 3.4 |
18.7 |
35.2 |
2.23 ± 0.36 |
|
137.1 ± 11.6 |
122.3 |
178.7 |
11.91 ± 1.50 |
Inheritance function recursion
Note: No results for C++, slow benchmark, but only quick requested
Source
local fibnext = {
a: super.a + super.b,
b: super.a,
};
local fib(n) =
if n == 0 then
{ a: 1, b: 1 }
else
fib(n - 1) + fibnext;
fib(25)
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
853.7 ± 218.7 |
633.9 |
3225.6 |
1.04 ± 0.37 |
|
840.1 ± 248.6 |
641.3 |
3157.4 |
1.02 ± 0.40 |
|
821.1 ± 205.5 |
652.4 |
2766.4 |
1.00 |
|
1490.8 ± 380.8 |
1037.0 |
3584.4 |
1.82 ± 0.65 |
|
1538.2 ± 350.0 |
1237.3 |
4011.9 |
1.87 ± 0.63 |
|
3067.2 ± 561.2 |
2169.7 |
5725.8 |
3.74 ± 1.16 |
|
1995.8 ± 475.6 |
1436.2 |
5992.0 |
2.43 ± 0.84 |
String strips
Note: No results for C++, too slow, takes hours, skews results
Source
// This string must be longer than max stack frames
local veryLongString = std.join('', std.repeat(['e'], 510));
std.assertEqual(std.stripChars(veryLongString + 'ok' + veryLongString, 'e'), 'ok') &&
std.assertEqual(std.lstripChars(veryLongString + 'ok', 'e'), 'ok') &&
std.assertEqual(std.rstripChars('ok' + veryLongString, 'e'), 'ok') &&
true
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
818.6 ± 195.1 |
631.5 |
3139.1 |
1.00 |
|
881.6 ± 266.1 |
638.7 |
3228.6 |
1.08 ± 0.41 |
|
6745.2 ± 1361.0 |
5310.4 |
10538.1 |
8.24 ± 2.57 |
|
1642.3 ± 431.3 |
1148.4 |
4036.4 |
2.01 ± 0.71 |
|
9171.4 ± 1488.9 |
5882.7 |
13881.3 |
11.20 ± 3.23 |
|
3513.3 ± 909.0 |
2382.5 |
6258.2 |
4.29 ± 1.51 |
|
2989.2 ± 788.2 |
1705.8 |
6001.7 |
3.65 ± 1.30 |
Big object
Source
// Generator source
local n = 2000;
local objLocal(name, body) = 'local ' + name + ' = ' + body + ',';
local objField(name, body) = name + ': ' + body + ',';
local allLocals =
std.makeArray(n, function(i) objLocal('l' + i, '1'));
local allFields =
std.makeArray(n, function(i) objField('f' + i, '2'));
local indent = ' ';
local indentAndSeparate(s) = indent + s + '\n';
local objContents = std.map(indentAndSeparate, allLocals + allFields);
local objectBody = std.join('', objContents);
'{\n' + objectBody + '}\n'
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
1.2 ± 0.3 |
0.8 |
3.2 |
1.03 ± 0.38 |
|
1.2 ± 0.3 |
0.8 |
3.4 |
1.00 |
|
1.3 ± 0.3 |
0.9 |
4.0 |
1.12 ± 0.41 |
|
1.5 ± 0.3 |
1.2 |
4.3 |
1.28 ± 0.41 |
|
2.9 ± 0.3 |
2.4 |
5.1 |
2.49 ± 0.71 |
|
4.7 ± 0.5 |
3.5 |
6.9 |
4.10 ± 1.15 |
|
3.6 ± 0.4 |
2.8 |
6.0 |
3.10 ± 0.88 |
|
18.9 ± 1.6 |
16.7 |
25.9 |
16.41 ± 4.49 |
Benchmarks from Go jsonnet (builtins)
std.base64
Note: No results for Rust (alternative), slow benchmark, but only quick requested
Note: No results for C++, too slow, takes hours, skews results
Source
{
foo: [
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)
],
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
1.8 ± 0.4 |
1.2 |
5.3 |
1.01 ± 0.41 |
|
1.8 ± 0.6 |
1.2 |
5.1 |
1.00 |
|
2.1 ± 0.7 |
1.3 |
6.0 |
1.18 ± 0.56 |
|
9.2 ± 0.8 |
7.9 |
13.5 |
5.26 ± 1.78 |
|
6.0 ± 1.0 |
4.4 |
10.5 |
3.39 ± 1.25 |
|
3.9 ± 0.7 |
2.9 |
7.9 |
2.22 ± 0.84 |
std.base64Decode
Note: No results for Rust (alternative), slow benchmark, but only quick requested
Note: No results for C++, slow benchmark, but only quick requested
Source
{
foo: [
std.base64Decode("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIG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0,100)
],
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
1.5 ± 0.4 |
1.1 |
4.4 |
1.00 |
|
1.6 ± 0.5 |
1.1 |
5.0 |
1.07 ± 0.47 |
|
2.0 ± 0.6 |
1.2 |
6.0 |
1.39 ± 0.58 |
|
8.3 ± 0.8 |
6.9 |
11.9 |
5.65 ± 1.77 |
|
5.0 ± 0.9 |
3.8 |
9.1 |
3.42 ± 1.18 |
|
3.4 ± 0.7 |
2.6 |
7.4 |
2.30 ± 0.83 |
std.base64DecodeBytes
Note: No results for Rust (alternative), slow benchmark, but only quick requested
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, slow benchmark, but only quick requested
Source
{
foo: [
std.base64DecodeBytes("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEuIFNlZCB0dXJwaXMgdGluY2lkdW50IGlkIGFsaXF1ZXQgcmlzdXMuIEVnZXQgbWF1cmlzIHBoYXJldHJhIGV0IHVsdHJpY2VzIG5lcXVlIG9ybmFyZSBhZW5lYW4gZXVpc21vZC4gRGlhbSBxdWlzIGVuaW0gbG9ib3J0aXMgc2NlbGVyaXNxdWUgZmVybWVudHVtLiBWYXJpdXMgZHVpcyBhdCBjb25zZWN0ZXR1ciBsb3JlbSBkb25lYyBtYXNzYSBzYXBpZW4uIERpYW0gc2l0IGFtZXQgbmlzbCBzdXNjaXBpdCBhZGlwaXNjaW5nIGJpYmVuZHVtIGVzdCB1bHRyaWNpZXMgaW50ZWdlci4gTGVjdHVzIHVybmEgZHVpcyBjb252YWxsaXMgY29udmFsbGlzIHRlbGx1cy4gTmliaCBpcHN1bSBjb25zZXF1YXQgbmlzbCB2ZWwgcHJldGl1bSBsZWN0dXMgcXVhbSBpZCB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XVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4gU2NlbGVyaXNxdWUgbWF1cmlzIHBlbGxlbnRlc3F1ZSBwdWx2aW5hciBwZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzLiBTY2VsZXJpc3F1ZSBtYXVyaXMgcGVsbGVudGVzcXVlIHB1bHZpbmFyIHBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMuIFNjZWxlcmlzcXVlIG1hdXJpcyBwZWxsZW50ZXNxdWUgcHVsdmluYXIgcGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cy4=") for i in std.range(0,100)
],
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
23.9 ± 1.8 |
21.4 |
30.6 |
1.06 ± 0.13 |
|
24.7 ± 2.1 |
21.9 |
30.8 |
1.10 ± 0.14 |
|
22.5 ± 2.1 |
19.6 |
28.6 |
1.00 |
|
42.1 ± 2.7 |
35.7 |
51.2 |
1.87 ± 0.21 |
|
32.7 ± 2.1 |
28.2 |
37.4 |
1.45 ± 0.17 |
std.base64 (byte array)
Note: No results for Rust (alternative), slow benchmark, but only quick requested
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, slow benchmark, but only quick requested
Source
{
foo: [
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)
],
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
19.1 ± 0.9 |
17.7 |
22.8 |
2.81 ± 0.44 |
|
22.9 ± 1.3 |
20.4 |
27.2 |
3.36 ± 0.53 |
|
17.4 ± 1.2 |
16.0 |
24.9 |
2.55 ± 0.42 |
|
8.6 ± 1.2 |
6.3 |
14.4 |
1.27 ± 0.26 |
|
6.8 ± 1.0 |
5.3 |
10.9 |
1.00 |
std.foldl
Source
local input = std.makeArray(10000, function(i) 'xxxxx');
std.foldl(function(acc, value) acc + value, input, '')
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
2.7 ± 0.3 |
2.3 |
5.2 |
1.03 ± 0.18 |
|
2.6 ± 0.3 |
2.3 |
4.9 |
1.00 |
|
2.8 ± 0.4 |
2.4 |
7.7 |
1.08 ± 0.19 |
|
30.6 ± 3.0 |
23.3 |
39.1 |
11.84 ± 1.84 |
|
1173.8 ± 18.4 |
1134.5 |
1210.5 |
454.70 ± 55.66 |
|
83.5 ± 5.0 |
76.5 |
96.3 |
32.36 ± 4.38 |
|
65.4 ± 4.0 |
55.9 |
74.7 |
25.35 ± 3.44 |
|
187.7 ± 6.3 |
178.7 |
201.8 |
72.71 ± 9.16 |
std.manifestJsonEx
Note: No results for C++, slow benchmark, but only quick requested
Source
{
bar: {
prometheusOperator+: {
service+: {
spec+: {
ports: [
{
name: 'https',
port: 8443,
targetPort: 'https',
},
],
},
},
serviceMonitor+: {
spec+: {
endpoints: [
{
port: 'https',
scheme: 'https',
honorLabels: true,
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
tlsConfig: {
insecureSkipVerify: true,
},
},
]
},
},
clusterRole+: {
rules+: [
{
apiGroups: ['authentication.k8s.io'],
resources: ['tokenreviews'],
verbs: ['create'],
},
{
apiGroups: ['authorization.k8s.io'],
resources: ['subjectaccessreviews'],
verbs: ['create'],
},
],
},
}
},
foo: std.manifestJsonEx(self.bar, " ")
}
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
843.6 ± 223.0 |
656.6 |
4127.4 |
1.04 ± 0.39 |
|
813.0 ± 213.3 |
642.3 |
3413.8 |
1.00 |
|
845.1 ± 218.6 |
663.7 |
3241.0 |
1.04 ± 0.38 |
|
1282.1 ± 289.2 |
1019.9 |
3714.4 |
1.58 ± 0.55 |
|
1601.1 ± 422.3 |
1237.9 |
5025.6 |
1.97 ± 0.73 |
|
2750.4 ± 503.1 |
2134.1 |
5361.6 |
3.38 ± 1.08 |
|
1897.5 ± 451.5 |
1485.7 |
5449.9 |
2.33 ± 0.83 |
std.manifestTomlEx
Note: No results for C++, slow benchmark, but only quick requested
Source
{
bar: {
prometheusOperator+: {
service+: {
spec+: {
ports: [
{
name: 'https',
port: 8443,
targetPort: 'https',
},
],
},
},
serviceMonitor+: {
spec+: {
endpoints: [
{
port: 'https',
scheme: 'https',
honorLabels: true,
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token',
tlsConfig: {
insecureSkipVerify: true,
},
},
],
},
},
clusterRole+: {
rules+: [
{
apiGroups: ['authentication.k8s.io'],
resources: ['tokenreviews'],
verbs: ['create'],
},
{
apiGroups: ['authorization.k8s.io'],
resources: ['subjectaccessreviews'],
verbs: ['create'],
},
],
},
},
},
nothing: std.manifestTomlEx(self.bar, ' '),
}
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
763.4 ± 191.9 |
633.3 |
3624.8 |
1.00 |
|
827.8 ± 231.9 |
650.9 |
3128.1 |
1.08 ± 0.41 |
|
852.5 ± 209.2 |
674.0 |
2880.1 |
1.12 ± 0.39 |
|
1296.1 ± 278.3 |
1008.8 |
3817.0 |
1.70 ± 0.56 |
|
1653.9 ± 379.9 |
1242.0 |
3968.9 |
2.17 ± 0.74 |
|
2950.5 ± 521.5 |
2308.7 |
5281.5 |
3.86 ± 1.19 |
|
1903.0 ± 402.9 |
1498.6 |
5037.9 |
2.49 ± 0.82 |
std.parseInt
Note: No results for C++, slow benchmark, but only quick requested
Source
{
foo: [
std.parseInt("-123949595") for i in std.range(0,100)
],
}
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
805.9 ± 184.3 |
620.1 |
2679.7 |
1.03 ± 0.31 |
|
780.1 ± 147.8 |
639.4 |
2606.9 |
1.00 |
|
803.9 ± 133.5 |
671.5 |
2839.0 |
1.03 ± 0.26 |
|
1211.2 ± 169.4 |
1028.5 |
3194.9 |
1.55 ± 0.37 |
|
1521.1 ± 292.6 |
1215.8 |
3432.6 |
1.95 ± 0.53 |
|
2431.3 ± 379.6 |
2060.0 |
5090.0 |
3.12 ± 0.77 |
|
1569.7 ± 263.7 |
1332.6 |
4578.6 |
2.01 ± 0.51 |
std.reverse
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, slow benchmark, but only quick requested
Source
{
foo: [
std.reverse(std.range(0, 5000)) for i in std.range(0,100)
],
}
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
29.1 ± 2.0 |
26.3 |
37.5 |
1.04 ± 0.10 |
|
31.0 ± 2.4 |
27.3 |
41.0 |
1.11 ± 0.12 |
|
27.9 ± 2.0 |
24.7 |
34.1 |
1.00 |
|
61.1 ± 2.8 |
55.2 |
67.2 |
2.19 ± 0.19 |
|
54.8 ± 2.5 |
49.2 |
63.4 |
1.96 ± 0.17 |
|
38.7 ± 1.9 |
35.4 |
43.7 |
1.39 ± 0.12 |
std.substr
Source
{
foo: [
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)
],
}
Command |
Mean [µs] |
Min [µs] |
Max [µs] |
Relative |
|
962.2 ± 229.2 |
828.4 |
3431.0 |
1.00 ± 0.35 |
|
958.4 ± 243.6 |
801.4 |
3611.0 |
1.00 |
|
962.6 ± 168.6 |
848.0 |
4656.2 |
1.00 ± 0.31 |
|
1510.8 ± 192.9 |
1341.7 |
3548.9 |
1.58 ± 0.45 |
|
3403.4 ± 404.7 |
2843.4 |
6024.9 |
3.55 ± 1.00 |
|
3267.8 ± 454.9 |
2645.9 |
5306.1 |
3.41 ± 0.99 |
|
2195.9 ± 307.6 |
1846.1 |
4205.0 |
2.29 ± 0.66 |
|
18430.8 ± 1082.9 |
16240.2 |
21665.0 |
19.23 ± 5.02 |
Comparsion for array
Note: No results for C++, too slow, takes hours, skews results
Source
local long_array = std.range(1, 1000000);
long_array + [1] < long_array + [2]
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
13.2 ± 0.6 |
12.4 |
16.6 |
1.01 ± 0.06 |
|
13.1 ± 0.5 |
12.4 |
15.3 |
1.00 |
|
17.9 ± 0.6 |
16.8 |
19.5 |
1.37 ± 0.07 |
|
73.3 ± 6.3 |
56.7 |
88.2 |
5.61 ± 0.54 |
|
85.8 ± 7.7 |
56.2 |
94.2 |
6.56 ± 0.65 |
|
41.8 ± 3.9 |
32.2 |
51.5 |
3.20 ± 0.33 |
|
68.7 ± 1.6 |
65.8 |
73.2 |
5.26 ± 0.25 |
Comparsion for primitives
Note: No results for Rust (alternative), slow benchmark, but only quick requested
Note: No results for Go, slow benchmark, but only quick requested
Note: No results for C++, can’t run: uses up to 192GB of RAM
Source
([ i < j for i in std.range(1, 1000) for j in std.range(1, 1000)])
Command |
Mean [ms] |
Min [ms] |
Max [ms] |
Relative |
|
90.3 ± 2.1 |
86.8 |
95.3 |
1.00 |
|
97.9 ± 2.8 |
93.6 |
107.6 |
1.08 ± 0.04 |
|
245.2 ± 6.2 |
230.5 |
256.4 |
2.72 ± 0.09 |
|
224.5 ± 27.6 |
182.7 |
264.0 |
2.49 ± 0.31 |
|
222.4 ± 4.1 |
215.6 |
231.6 |
2.46 ± 0.07 |