difftreelog
ci fix omitSource
in: master
1 file changed
nix/benchmarks.nixdiffbeforeafterboth717172 installPhase =72 installPhase =73 let73 let74 mkBench = { name, path, omitSource ? false, pathIsGenerator ? false, skipScala ? "", skipCpp ? "", skipGo ? "", vendor ? "" }: ''74 mkBench = { name, path, omitSource ? false, pathIsGenerator ? false, skipScala ? "", skipCpp ? "", skipGo ? "", vendor ? "" }: ''75 set -oux75 set -oux767677 echo >> $out77 echo >> $out78 echo "### ${name}" >> $out78 echo "### ${name}" >> $out79 echo >> $out79 echo >> $out80 ${if skipGo != "" then ''80 ${if skipGo != "" then ''81 echo "> Note: No results for Go, ${skipGo}" >> $out81 echo "> Note: No results for Go, ${skipGo}" >> $out82 echo >> $out82 echo >> $out83 '' else ""}83 '' else ""}84 ${if skipScala != "" then ''84 ${if skipScala != "" then ''85 echo "> Note: No results for Scala, ${skipScala}" >> $out85 echo "> Note: No results for Scala, ${skipScala}" >> $out86 echo >> $out86 echo >> $out87 '' else ""}87 '' else ""}88 ${if skipCpp != "" then ''88 ${if skipCpp != "" then ''89 echo "> Note: No results for C++, ${skipCpp}" >> $out89 echo "> Note: No results for C++, ${skipCpp}" >> $out90 echo >> $out90 echo >> $out91 '' else ""}91 '' else ""}92 echo "<details>" >> $out92 echo "<details>" >> $out93 echo "<summary>Source</summary>" >> $out93 echo "<summary>Source</summary>" >> $out94 echo >> $out94 echo >> $out95 echo "\`\`\`jsonnet" >> $out95 echo "\`\`\`jsonnet" >> $out96 ${if pathIsGenerator then "echo \"// Generator source\" >> $out" else ""}96 ${if pathIsGenerator then "echo \"// Generator source\" >> $out" else ""}97 cat ${if omitSource then "// Omitted: too large" else path} >> $out97 ${if omitSource then "echo \"// Omitted: too large\" >> $out" else "cat ${path} >> $out"}98 echo >> $out98 echo >> $out99 echo "\`\`\`" >> $out99 echo "\`\`\`" >> $out100 echo "</details>" >> $out100 echo "</details>" >> $out101 echo >> $out101 echo >> $out102 path=${path}102 path=${path}103 ${if pathIsGenerator then ''103 ${if pathIsGenerator then ''104 jrsonnet $path > generated.jsonnet104 jrsonnet $path > generated.jsonnet105 path=generated.jsonnet105 path=generated.jsonnet106 '' else ""}106 '' else ""}107 hyperfine -N ${if quick then "-r1" else ""} --output=pipe --style=basic --export-markdown result.md \107 hyperfine -N ${if quick then "-r1" else ""} --output=pipe --style=basic --export-markdown result.md \108 "jrsonnet $path ${if vendor != "" then "-J${vendor}" else ""}" -n "Rust" \108 "jrsonnet $path ${if vendor != "" then "-J${vendor}" else ""}" -n "Rust" \109 ${if skipGo == "" then "\"go-jsonnet $path ${if vendor != "" then "-J ${vendor}" else ""}\" -n \"Go\"" else "" } \109 ${if skipGo == "" then "\"go-jsonnet $path ${if vendor != "" then "-J ${vendor}" else ""}\" -n \"Go\"" else "" } \110 ${if skipScala == "" then "\"sjsonnet $path ${if vendor != "" then "-J ${vendor}" else ""}\" -n \"Scala\"" else "" } \110 ${if skipScala == "" then "\"sjsonnet $path ${if vendor != "" then "-J ${vendor}" else ""}\" -n \"Scala\"" else "" } \111 ${if skipCpp == "" then "\"jsonnet $path ${if vendor != "" then "-J ${vendor}" else ""}\" -n \"C++\"" else "" }111 ${if skipCpp == "" then "\"jsonnet $path ${if vendor != "" then "-J ${vendor}" else ""}\" -n \"C++\"" else "" }112 cat result.md >> $out112 cat result.md >> $out113 '';113 '';114 in114 in115 ''115 ''116 touch $out116 touch $out117 cat ${./benchmarks.md} >> $out117 cat ${./benchmarks.md} >> $out118 echo >> $out118 echo >> $out119119120 echo "<details>" >> $out120 echo "<details>" >> $out121 echo "<summary>Tested versions</summary>" >> $out121 echo "<summary>Tested versions</summary>" >> $out122 echo >> $out122 echo >> $out123 echo Rust: git as $(date +'%d.%m.%Y' -u) >> $out123 echo Rust: git as $(date +'%d.%m.%Y' -u) >> $out124 echo >> $out124 echo >> $out125 echo "\`\`\`" >> $out125 echo "\`\`\`" >> $out126 jrsonnet --help >> $out126 jrsonnet --help >> $out127 echo "\`\`\`" >> $out127 echo "\`\`\`" >> $out128 echo >> $out128 echo >> $out129 echo Go: $(go-jsonnet --version) >> $out129 echo Go: $(go-jsonnet --version) >> $out130 echo >> $out130 echo >> $out131 echo "\`\`\`" >> $out131 echo "\`\`\`" >> $out132 go-jsonnet --help >> $out132 go-jsonnet --help >> $out133 echo "\`\`\`" >> $out133 echo "\`\`\`" >> $out134 echo >> $out134 echo >> $out135 echo C++: $(jsonnet --version) >> $out135 echo C++: $(jsonnet --version) >> $out136 echo >> $out136 echo >> $out137 echo "\`\`\`" >> $out137 echo "\`\`\`" >> $out138 jsonnet --help >> $out138 jsonnet --help >> $out139 echo "\`\`\`" >> $out139 echo "\`\`\`" >> $out140 echo >> $out140 echo >> $out141 echo Scala: >> $out141 echo Scala: >> $out142 echo >> $out142 echo >> $out143 echo "\`\`\`" >> $out143 echo "\`\`\`" >> $out144 sjsonnet 2>> $out || true144 sjsonnet 2>> $out || true145 echo "\`\`\`" >> $out145 echo "\`\`\`" >> $out146 echo >> $out146 echo >> $out147 echo "</details>" >> $out147 echo "</details>" >> $out148 echo >> $out148 echo >> $out149149150 echo >> $out150 echo >> $out151 echo "## Real world" >> $out151 echo "## Real world" >> $out152 ${mkBench {name = "Graalvm CI"; path = "${graalvmBench}/ci.jsonnet"; skipCpp = skipSlow;}}152 ${mkBench {name = "Graalvm CI"; path = "${graalvmBench}/ci.jsonnet"; skipCpp = "takes longer than a hour";}}153 ${mkBench {name = "Kube-prometheus manifests"; vendor = "${kubePrometheusBench}/vendor"; path = "${kubePrometheusBench}/example.jsonnet"; skipCpp = skipSlow;}}153 ${mkBench {name = "Kube-prometheus manifests"; vendor = "${kubePrometheusBench}/vendor"; path = "${kubePrometheusBench}/example.jsonnet"; skipCpp = skipSlow;}}154154155 echo >> $out155 echo >> $out156 echo "## Benchmarks from C++ jsonnet (/perf_tests)" >> $out156 echo "## Benchmarks from C++ jsonnet (/perf_tests)" >> $out157 ${mkBench {name = "Large string join"; path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";}}157 ${mkBench {name = "Large string join"; path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";}}158 ${mkBench {name = "Large string template"; omitSource = true; path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet"; skipGo = "fails with os stack size exhausion"; skipCpp = skipSlow;}}158 ${mkBench {name = "Large string template"; omitSource = true; path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet"; skipGo = "fails with os stack size exhausion"; skipCpp = skipSlow;}}159 ${mkBench {name = "Realistic 1"; path = "${jsonnetBench}/perf_tests/realistic1.jsonnet"; skipGo = skipSlow; skipCpp = skipSlow;}}159 ${mkBench {name = "Realistic 1"; path = "${jsonnetBench}/perf_tests/realistic1.jsonnet"; skipGo = skipSlow; skipCpp = skipSlow;}}160 ${mkBench {name = "Realistic 2"; path = "${jsonnetBench}/perf_tests/realistic2.jsonnet"; skipGo = skipSlow; skipCpp = skipSlow;}}160 ${mkBench {name = "Realistic 2"; path = "${jsonnetBench}/perf_tests/realistic2.jsonnet"; skipGo = skipSlow; skipCpp = skipSlow;}}161161162 echo >> $out162 echo >> $out163 echo "## Benchmarks from C++ jsonnet (/benchmarks)" >> $out163 echo "## Benchmarks from C++ jsonnet (/benchmarks)" >> $out164 ${mkBench {name = "Tail call"; path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";}}164 ${mkBench {name = "Tail call"; path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";}}165 ${mkBench {name = "Inheritance recursion"; path = "${jsonnetBench}/benchmarks/bench.02.jsonnet"; skipCpp = skipSlow;}}165 ${mkBench {name = "Inheritance recursion"; path = "${jsonnetBench}/benchmarks/bench.02.jsonnet"; skipCpp = skipSlow;}}166 ${mkBench {name = "Simple recursive call"; path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";}}166 ${mkBench {name = "Simple recursive call"; path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";}}167 ${mkBench {name = "Foldl string concat"; path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";}}167 ${mkBench {name = "Foldl string concat"; path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";}}168 ${mkBench {name = "Array sorts"; path = "${jsonnetBench}/benchmarks/bench.06.jsonnet"; skipScala = "std.reverse is not implemented"; skipCpp = skipSlow;}}168 ${mkBench {name = "Array sorts"; path = "${jsonnetBench}/benchmarks/bench.06.jsonnet"; skipScala = "std.reverse is not implemented"; skipCpp = skipSlow;}}169 ${mkBench {name = "Lazy array"; path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";}}169 ${mkBench {name = "Lazy array"; path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";}}170 ${mkBench {name = "Inheritance function recursion"; path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";}}170 ${mkBench {name = "Inheritance function recursion"; path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";}}171 ${mkBench {name = "String strips"; path = "${jsonnetBench}/benchmarks/bench.09.jsonnet"; skipCpp = skipSlow;}}171 ${mkBench {name = "String strips"; path = "${jsonnetBench}/benchmarks/bench.09.jsonnet"; skipCpp = skipSlow;}}172 ${mkBench {name = "Big object"; path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet"; pathIsGenerator = true;}}172 ${mkBench {name = "Big object"; path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet"; pathIsGenerator = true;}}173173174 echo >> $out174 echo >> $out175 echo "## Benchmarks from Go jsonnet (builtins)" >> $out175 echo "## Benchmarks from Go jsonnet (builtins)" >> $out176 ${mkBench {name = "std.base64"; path = "${goJsonnetBench}/base64.jsonnet"; skipCpp = skipSlow;}}176 ${mkBench {name = "std.base64"; path = "${goJsonnetBench}/base64.jsonnet"; skipCpp = skipSlow;}}177 ${mkBench {name = "std.base64Decode"; path = "${goJsonnetBench}/base64Decode.jsonnet"; skipCpp = skipSlow;}}177 ${mkBench {name = "std.base64Decode"; path = "${goJsonnetBench}/base64Decode.jsonnet"; skipCpp = skipSlow;}}178 ${mkBench {name = "std.base64DecodeBytes"; path = "${goJsonnetBench}/base64DecodeBytes.jsonnet"; skipCpp = skipSlow;}}178 ${mkBench {name = "std.base64DecodeBytes"; path = "${goJsonnetBench}/base64DecodeBytes.jsonnet"; skipCpp = skipSlow;}}179 ${mkBench {name = "std.base64 (byte array)"; path = "${goJsonnetBench}/base64_byte_array.jsonnet"; skipCpp = skipSlow;}}179 ${mkBench {name = "std.base64 (byte array)"; path = "${goJsonnetBench}/base64_byte_array.jsonnet"; skipCpp = skipSlow;}}180 ${mkBench {name = "std.foldl"; path = "${goJsonnetBench}/foldl.jsonnet";}}180 ${mkBench {name = "std.foldl"; path = "${goJsonnetBench}/foldl.jsonnet";}}181 ${mkBench {name = "std.manifestJsonEx"; path = "${goJsonnetBench}/manifestJsonEx.jsonnet";}}181 ${mkBench {name = "std.manifestJsonEx"; path = "${goJsonnetBench}/manifestJsonEx.jsonnet";}}182 ${mkBench {name = "std.manifestTomlEx"; path = "${goJsonnetBench}/manifestTomlEx.jsonnet"; skipScala = "std.manifestTomlEx is not implemented";}}182 ${mkBench {name = "std.manifestTomlEx"; path = "${goJsonnetBench}/manifestTomlEx.jsonnet"; skipScala = "std.manifestTomlEx is not implemented";}}183 ${mkBench {name = "std.parseInt"; path = "${goJsonnetBench}/parseInt.jsonnet";}}183 ${mkBench {name = "std.parseInt"; path = "${goJsonnetBench}/parseInt.jsonnet";}}184 ${mkBench {name = "std.reverse"; path = "${goJsonnetBench}/reverse.jsonnet"; skipScala = "std.reverse is not implemented";}}184 ${mkBench {name = "std.reverse"; path = "${goJsonnetBench}/reverse.jsonnet"; skipScala = "std.reverse is not implemented";}}185 ${mkBench {name = "std.substr"; path = "${goJsonnetBench}/substr.jsonnet";}}185 ${mkBench {name = "std.substr"; path = "${goJsonnetBench}/substr.jsonnet";}}186 ${mkBench {name = "Comparsion for array"; path = "${goJsonnetBench}/comparison.jsonnet"; skipScala = "array comparsion is not implemented"; skipCpp = skipSlow;}}186 ${mkBench {name = "Comparsion for array"; path = "${goJsonnetBench}/comparison.jsonnet"; skipScala = "array comparsion is not implemented"; skipCpp = skipSlow;}}187 ${mkBench {name = "Comparsion for primitives"; path = "${goJsonnetBench}/comparison2.jsonnet"; skipCpp = "can't run: uses up to 192GB of RAM";}}187 ${mkBench {name = "Comparsion for primitives"; path = "${goJsonnetBench}/comparison2.jsonnet"; skipCpp = "can't run: uses up to 192GB of RAM";}}188 '';188 '';189}189}190190