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

difftreelog

doc: fix spoiler

Yaroslav Bolyukin2024-04-27parent: #8d2d633.patch.diff
in: master

2 files changed

modifieddocs/benchmarks.mddiffbeforeafterboth
--- a/docs/benchmarks.md
+++ b/docs/benchmarks.md
@@ -169,8 +169,6 @@
 
 ```
 
-</details>
-
 Rust (alternative):
 
 ```
@@ -201,7 +199,6 @@
 ```
 
 </details>
-
 
 ## Real world
 
modifiednix/benchmarks.nixdiffbeforeafterboth
139 ${optionalString (skipCpp == "") "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""}139 ${optionalString (skipCpp == "") "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""}
140 cat result.md >> $out140 cat result.md >> $out
141 '';141 '';
142 in ''142 in ''
143 set -oux143 set -oux
144144
145 temp=$(mktemp -d)145 temp=$(mktemp -d)
146 cd $temp146 cd $temp
147147
148 touch $out148 touch $out
149 ${optionalString (!quick) ''149 ${optionalString (!quick) ''
150 cat ${./benchmarks.md} >> $out150 cat ${./benchmarks.md} >> $out
151 echo >> $out151 echo >> $out
152152
153 echo "<details>" >> $out153 echo "<details>" >> $out
154 echo "<summary>Tested versions</summary>" >> $out154 echo "<summary>Tested versions</summary>" >> $out
155 echo >> $out155 echo >> $out
156 echo Go: $(go-jsonnet --version) >> $out156 echo Go: $(go-jsonnet --version) >> $out
157 echo >> $out157 echo >> $out
158 echo "\`\`\`" >> $out158 echo "\`\`\`" >> $out
159 go-jsonnet --help >> $out159 go-jsonnet --help >> $out
160 echo "\`\`\`" >> $out160 echo "\`\`\`" >> $out
161 echo >> $out161 echo >> $out
162 echo C++: $(jsonnet --version) >> $out162 echo C++: $(jsonnet --version) >> $out
163 echo >> $out163 echo >> $out
164 echo "\`\`\`" >> $out164 echo "\`\`\`" >> $out
165 jsonnet --help >> $out165 jsonnet --help >> $out
166 echo "\`\`\`" >> $out166 echo "\`\`\`" >> $out
167 echo >> $out167 echo >> $out
168 echo Scala: >> $out168 echo Scala: >> $out
169 echo >> $out169 echo >> $out
170 echo "\`\`\`" >> $out170 echo "\`\`\`" >> $out
171 sjsonnet 2>> $out || true171 sjsonnet 2>> $out || true
172 echo "\`\`\`" >> $out172 echo "\`\`\`" >> $out
173 echo >> $out173 echo >> $out
174 echo "</details>" >> $out174 echo "Rust (alternative):" >> $out
175 echo >> $out
176 echo "Rust (alternative):" >> $out175 echo >> $out
177 echo >> $out176 echo "\`\`\`" >> $out
178 echo "\`\`\`" >> $out177 rsjsonnet --help 2>> $out || true
179 rsjsonnet --help 2>> $out || true178 echo "\`\`\`" >> $out
180 echo "\`\`\`" >> $out179 echo >> $out
181 echo >> $out180 echo "</details>" >> $out
182 echo "</details>" >> $out181 echo >> $out
183 echo >> $out182
184183 echo >> $out
185 echo >> $out184 ''}
186 ''}185 echo "## Real world" >> $out
187 echo "## Real world" >> $out186 ${mkBench {
188 ${mkBench {187 name = "Graalvm CI";
189 name = "Graalvm CI";188 path = "${graalvmBench}/ci.jsonnet";
190 path = "${graalvmBench}/ci.jsonnet";189 skipCpp = "takes longer than a hour";
191 skipCpp = "takes longer than a hour";190 skipGo = skipSlow;
192 skipGo = skipSlow;191 skipScala = skipSlow;
193 skipScala = skipSlow;192 }}
194 }}193 ${mkBench {
195 ${mkBench {194 name = "Kube-prometheus manifests";
196 name = "Kube-prometheus manifests";195 vendor = "${kubePrometheusBench}/vendor";
197 vendor = "${kubePrometheusBench}/vendor";196 path = "${kubePrometheusBench}/example.jsonnet";
198 path = "${kubePrometheusBench}/example.jsonnet";197 skipCpp = skipSlow;
199 skipCpp = skipSlow;198 skipGo = skipSlow;
200 skipGo = skipSlow;199 skipScala = skipSlow;
201 skipScala = skipSlow;200 }}
202 }}201
203202 echo >> $out
204 echo >> $out203 echo "## Benchmarks from C++ jsonnet (/perf_tests)" >> $out
205 echo "## Benchmarks from C++ jsonnet (/perf_tests)" >> $out204 ${mkBench {
206 ${mkBench {205 name = "Large string join";
207 name = "Large string join";206 path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";
208 path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";207 skipScala = skipSlow;
209 skipScala = skipSlow;208 }}
210 }}209 ${mkBench {
211 ${mkBench {210 name = "Large string template";
212 name = "Large string template";211 omitSource = true;
213 omitSource = true;212 path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";
214 path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";213 skipGo = "fails with os stack size exhausion";
215 skipGo = "fails with os stack size exhausion";214 skipCpp = skipSlow;
216 skipCpp = skipSlow;215 skipScala = skipSlow;
217 skipScala = skipSlow;216 }}
218 }}217 ${mkBench {
219 ${mkBench {218 name = "Realistic 1";
220 name = "Realistic 1";219 path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";
221 path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";220 skipGo = skipSlow;
222 skipGo = skipSlow;221 skipCpp = skipSlow;
223 skipCpp = skipSlow;222 skipScala = skipSlow;
224 skipScala = skipSlow;223 }}
225 }}224 ${mkBench {
226 ${mkBench {225 name = "Realistic 2";
227 name = "Realistic 2";226 path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";
228 path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";227 skipGo = skipSlow;
229 skipGo = skipSlow;228 skipCpp = skipSlow;
230 skipCpp = skipSlow;229 skipScala = skipSlow;
231 skipScala = skipSlow;230 }}
232 }}231
233232 echo >> $out
234 echo >> $out233 echo "## Benchmarks from C++ jsonnet (/benchmarks)" >> $out
235 echo "## Benchmarks from C++ jsonnet (/benchmarks)" >> $out234 ${mkBench {
236 ${mkBench {235 name = "Tail call";
237 name = "Tail call";236 path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";
238 path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";237 skipScala = skipSlow;
239 skipScala = skipSlow;238 }}
240 }}239 ${mkBench {
241 ${mkBench {240 name = "Inheritance recursion";
242 name = "Inheritance recursion";241 path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";
243 path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";242 skipCpp = skipSlow;
244 skipCpp = skipSlow;243 skipGo = skipSlow;
245 skipGo = skipSlow;244 }}
246 }}245 ${mkBench {
247 ${mkBench {246 name = "Simple recursive call";
248 name = "Simple recursive call";247 path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";
249 path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";248 skipScala = skipSlow;
250 skipScala = skipSlow;249 skipGo = skipSlow;
251 skipGo = skipSlow;250 }}
252 }}251 ${mkBench {
253 ${mkBench {252 name = "Foldl string concat";
254 name = "Foldl string concat";253 path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";
255 path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";254 skipCpp = skipSlow;
256 skipCpp = skipSlow;255 skipScala = skipSlow;
257 skipScala = skipSlow;256 }}
258 }}257 ${mkBench {
259 ${mkBench {258 name = "Array sorts";
260 name = "Array sorts";259 path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";
261 path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";260 skipCpp = skipSlow;
262 skipCpp = skipSlow;261 # std.assertEqual(reverse(std.range(1, 1000)), sort(std.range(1, 1000), keyF=function(x) -x))
263 # std.assertEqual(reverse(std.range(1, 1000)), sort(std.range(1, 1000), keyF=function(x) -x))262 skipScala = "sjsonnet doesn't support keyF in std.sort: https://github.com/databricks/sjsonnet/issues/204";
264 skipScala = "sjsonnet doesn't support keyF in std.sort: https://github.com/databricks/sjsonnet/issues/204";263 }}
265 }}264 ${mkBench {
266 ${mkBench {265 name = "Lazy array";
267 name = "Lazy array";266 path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";
268 path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";267 skipGo = skipSlow;
269 skipGo = skipSlow;268 skipScala = skipSlow;
270 skipScala = skipSlow;269 }}
271 }}270 ${mkBench {
272 ${mkBench {271 name = "Inheritance function recursion";
273 name = "Inheritance function recursion";272 path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";
274 path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";273 skipCpp = skipSlow;
275 skipCpp = skipSlow;274 skipScala = skipSlow;
276 skipScala = skipSlow;275 }}
277 }}276 ${mkBench {
278 ${mkBench {277 name = "String strips";
279 name = "String strips";278 path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";
280 path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";279 skipCpp = skipSlow;
281 skipCpp = skipSlow;280 skipScala = skipSlow;
282 skipScala = skipSlow;281 }}
283 }}282 ${mkBench {
284 ${mkBench {283 name = "Big object";
285 name = "Big object";284 path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";
286 path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";285 pathIsGenerator = true;
287 pathIsGenerator = true;286 skipScala = skipSlow;
288 skipScala = skipSlow;287 }}
289 }}288
290289 echo >> $out
291 echo >> $out290 echo "## Benchmarks from Go jsonnet (builtins)" >> $out
292 echo "## Benchmarks from Go jsonnet (builtins)" >> $out291 ${mkBench {
293 ${mkBench {292 name = "std.base64";
294 name = "std.base64";293 path = "${goJsonnetBench}/base64.jsonnet";
295 path = "${goJsonnetBench}/base64.jsonnet";294 skipRustAlternative = skipSlow;
296 skipRustAlternative = skipSlow;295 skipCpp = skipSlow;
297 skipCpp = skipSlow;296 skipScala = skipSlow;
298 skipScala = skipSlow;297 }}
299 }}298 ${mkBench {
300 ${mkBench {299 name = "std.base64Decode";
301 name = "std.base64Decode";300 path = "${goJsonnetBench}/base64Decode.jsonnet";
302 path = "${goJsonnetBench}/base64Decode.jsonnet";301 skipRustAlternative = skipSlow;
303 skipRustAlternative = skipSlow;302 skipCpp = skipSlow;
304 skipCpp = skipSlow;303 skipScala = skipSlow;
305 skipScala = skipSlow;304 }}
306 }}305 ${mkBench {
307 ${mkBench {306 name = "std.base64DecodeBytes";
308 name = "std.base64DecodeBytes";307 path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";
309 path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";308 skipRustAlternative = skipSlow;
310 skipRustAlternative = skipSlow;309 skipCpp = skipSlow;
311 skipCpp = skipSlow;310 skipGo = skipSlow;
312 skipGo = skipSlow;311 skipScala = skipSlow;
313 skipScala = skipSlow;312 }}
314 }}313 ${mkBench {
315 ${mkBench {314 name = "std.base64 (byte array)";
316 name = "std.base64 (byte array)";315 path = "${goJsonnetBench}/base64_byte_array.jsonnet";
317 path = "${goJsonnetBench}/base64_byte_array.jsonnet";316 skipRustAlternative = skipSlow;
318 skipRustAlternative = skipSlow;317 skipCpp = skipSlow;
319 skipCpp = skipSlow;318 skipGo = skipSlow;
320 skipGo = skipSlow;319 skipScala = skipSlow;
321 skipScala = skipSlow;320 }}
322 }}321 ${mkBench {
323 ${mkBench {322 name = "std.foldl";
324 name = "std.foldl";323 path = "${goJsonnetBench}/foldl.jsonnet";
325 path = "${goJsonnetBench}/foldl.jsonnet";324 skipScala = skipSlow;
326 skipScala = skipSlow;325 }}
327 }}326 ${mkBench {
328 ${mkBench {327 name = "std.manifestJsonEx";
329 name = "std.manifestJsonEx";328 path = "${goJsonnetBench}/manifestJsonEx.jsonnet";
330 path = "${goJsonnetBench}/manifestJsonEx.jsonnet";329 skipScala = skipSlow;
331 skipScala = skipSlow;330 skipCpp = skipSlow;
332 skipCpp = skipSlow;331 }}
333 }}332 ${mkBench {
334 ${mkBench {333 name = "std.manifestTomlEx";
335 name = "std.manifestTomlEx";334 path = "${goJsonnetBench}/manifestTomlEx.jsonnet";
336 path = "${goJsonnetBench}/manifestTomlEx.jsonnet";335 skipScala = "std.manifestTomlEx is not implemented: https://github.com/databricks/sjsonnet/issues/111";
337 skipScala = "std.manifestTomlEx is not implemented: https://github.com/databricks/sjsonnet/issues/111";336 skipCpp = skipSlow;
338 skipCpp = skipSlow;337 }}
339 }}338 ${mkBench {
340 ${mkBench {339 name = "std.parseInt";
341 name = "std.parseInt";340 path = "${goJsonnetBench}/parseInt.jsonnet";
342 path = "${goJsonnetBench}/parseInt.jsonnet";341 skipScala = skipSlow;
343 skipScala = skipSlow;342 skipCpp = skipSlow;
344 skipCpp = skipSlow;343 }}
345 }}344 ${mkBench {
346 ${mkBench {345 name = "std.reverse";
347 name = "std.reverse";346 path = "${goJsonnetBench}/reverse.jsonnet";
348 path = "${goJsonnetBench}/reverse.jsonnet";347 skipCpp = skipSlow;
349 skipCpp = skipSlow;348 skipGo = skipSlow;
350 skipGo = skipSlow;349 }}
351 }}350 ${mkBench {
352 ${mkBench {351 name = "std.substr";
353 name = "std.substr";352 path = "${goJsonnetBench}/substr.jsonnet";
354 path = "${goJsonnetBench}/substr.jsonnet";353 skipScala = skipSlow;
355 skipScala = skipSlow;354 }}
356 }}355 ${mkBench {
357 ${mkBench {356 name = "Comparsion for array";
358 name = "Comparsion for array";357 path = "${goJsonnetBench}/comparison.jsonnet";
359 path = "${goJsonnetBench}/comparison.jsonnet";358 skipScala = "array comparsion is not implemented";
360 skipScala = "array comparsion is not implemented";359 skipCpp = skipSlow;
361 skipCpp = skipSlow;360 }}
362 }}361 ${mkBench {
363 ${mkBench {362 name = "Comparsion for primitives";
364 name = "Comparsion for primitives";363 path = "${goJsonnetBench}/comparison2.jsonnet";
365 path = "${goJsonnetBench}/comparison2.jsonnet";364 skipRustAlternative = skipSlow;
366 skipRustAlternative = skipSlow;365 skipCpp = "can't run: uses up to 192GB of RAM";
367 skipCpp = "can't run: uses up to 192GB of RAM";366 skipGo = skipSlow;
368 skipGo = skipSlow;367 skipScala = skipSlow;
369 skipScala = skipSlow;368 }}
370 }}369 '';
371 '';
372 }370 }
373371