Skip to content

Instantly share code, notes, and snippets.

@cmelchior
Created October 31, 2025 12:34
Show Gist options
  • Save cmelchior/84e4f13a20e7204202d63b2ee4f151ec to your computer and use it in GitHub Desktop.
Save cmelchior/84e4f13a20e7204202d63b2ee4f151ec to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells" : [ {
"metadata" : {
"collapsed" : true
},
"cell_type" : "markdown",
"source" : [ "# Simple Benchmark Analysis\n", "This notebook demonstrates how you can analyze and plot benchmark results from a single benchmark run.\n", "Several projects exist in the `examples` folder, but this notebook assumes we are working on the\n", "JVM part of the `kotlin-multiplatform` project. But the same approach can be used for the other projects.\n", "\n", "First, you need to run the benchmark. This can be done by running this command from the root of the project:\n", "\n", "```shell\n", "./gradlew :examples:kotlin-multiplatform:jvmBenchmark\n", "```\n", "\n", "Once it is completed, run this notebook, and it will automatically find the latest result." ],
"id" : "48c7cea4874504b5"
}, {
"metadata" : {
"executionRelatedData" : {
"compiledClasses" : [ "Line_3_jupyter", "Line_13_jupyter", "Line_2_jupyter", "Line_5_jupyter", "Line_11_jupyter", "Line_4_jupyter", "Line_9_jupyter", "Line_12_jupyter", "Line_7_jupyter", "Line_10_jupyter", "Line_8_jupyter", "Line_15_jupyter", "Line_6_jupyter", "Line_14_jupyter", "Line_16_jupyter", "Line_17_jupyter", "Line_18_jupyter" ]
},
"ExecuteTime" : {
"end_time" : "2025-10-31T12:29:53.045040Z",
"start_time" : "2025-10-31T12:29:47.264463Z"
}
},
"cell_type" : "code",
"source" : "%use serialization, dataframe, kandy",
"id" : "a9a968658398faed",
"outputs" : [ ],
"execution_count" : 3
}, {
"metadata" : {
"executionRelatedData" : {
"compiledClasses" : [ "Line_18_jupyter", "Line_17_jupyter", "Line_16_jupyter", "Line_22_jupyter", "Line_23_jupyter", "Line_24_jupyter", "Line_19_jupyter" ]
},
"ExecuteTime" : {
"end_time" : "2025-10-31T12:30:01.787990Z",
"start_time" : "2025-10-31T12:30:01.250973Z"
}
},
"cell_type" : "code",
"source" : [ "import java.nio.file.Files\n", "import java.nio.file.attribute.BasicFileAttributes\n", "import kotlin.io.path.exists\n", "import kotlin.io.path.forEachDirectoryEntry\n", "import kotlin.io.path.isDirectory\n", "import kotlin.io.path.listDirectoryEntries\n", "import kotlin.io.path.readText\n", "\n", "// Find latest result file, based on the their timestamp.\n", "//val runsDir = notebook.workingDir.resolve(\"...\")\n", "val outputFile = notebook.workingDir.resolve(\"../main.json\")\n", "val benchmarkData = outputFile.readText()\n", "benchmarkData" ],
"id" : "5100c648b781a7a6",
"outputs" : [ {
"data" : {
"application/json" : [ {
"jmhVersion" : "1.37",
"benchmark" : "test.CompareHypothesis.invSqrtBaseline",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/filipp.zhinkin/.gradle/jdks/amazon_com_inc_-8-aarch64-os_x/amazon-corretto-8.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [ "-Dfile.encoding=UTF-8", "-Duser.country=US", "-Duser.language=en", "-Duser.variant" ],
"jdkVersion" : "1.8.0_422",
"vmName" : "OpenJDK 64-Bit Server VM",
"vmVersion" : "25.422-b05",
"warmupIterations" : 3,
"warmupTime" : "5 s",
"warmupBatchSize" : 1,
"measurementIterations" : 3,
"measurementTime" : "5 s",
"measurementBatchSize" : 1,
"primaryMetric" : {
"score" : 8.203977554632516E8,
"scoreError" : 1.1337770231189007E7,
"scoreConfidence" : [ 8.090599852320626E8, 8.317355256944406E8 ],
"scorePercentiles" : {
"0.0" : 8.197133288452934E8,
"50.0" : 8.205531948987743E8,
"90.0" : 8.209267426456873E8,
"95.0" : 8.209267426456873E8,
"99.0" : 8.209267426456873E8,
"99.9" : 8.209267426456873E8,
"99.99" : 8.209267426456873E8,
"99.999" : 8.209267426456873E8,
"99.9999" : 8.209267426456873E8,
"100.0" : 8.209267426456873E8
},
"scoreUnit" : "ops/s",
"rawData" : [ [ 8.197133288452934E8, 8.209267426456873E8, 8.205531948987743E8 ] ]
},
"secondaryMetrics" : { }
}, {
"jmhVersion" : "1.37",
"benchmark" : "test.CompareHypothesis.invSqrtOptimized",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/Users/filipp.zhinkin/.gradle/jdks/amazon_com_inc_-8-aarch64-os_x/amazon-corretto-8.jdk/Contents/Home/jre/bin/java",
"jvmArgs" : [ "-Dfile.encoding=UTF-8", "-Duser.country=US", "-Duser.language=en", "-Duser.variant" ],
"jdkVersion" : "1.8.0_422",
"vmName" : "OpenJDK 64-Bit Server VM",
"vmVersion" : "25.422-b05",
"warmupIterations" : 3,
"warmupTime" : "5 s",
"warmupBatchSize" : 1,
"measurementIterations" : 3,
"measurementTime" : "5 s",
"measurementBatchSize" : 1,
"primaryMetric" : {
"score" : 6.561712309456968E8,
"scoreError" : 1.06182674607018E7,
"scoreConfidence" : [ 6.45552963484995E8, 6.667894984063987E8 ],
"scorePercentiles" : {
"0.0" : 6.55560459019124E8,
"50.0" : 6.562337813814477E8,
"90.0" : 6.567194524365189E8,
"95.0" : 6.567194524365189E8,
"99.0" : 6.567194524365189E8,
"99.9" : 6.567194524365189E8,
"99.99" : 6.567194524365189E8,
"99.999" : 6.567194524365189E8,
"99.9999" : 6.567194524365189E8,
"100.0" : 6.567194524365189E8
},
"scoreUnit" : "ops/s",
"rawData" : [ [ 6.567194524365189E8, 6.562337813814477E8, 6.55560459019124E8 ] ]
},
"secondaryMetrics" : { }
} ],
"text/plain" : [ "[\n", " {\n", " \"jmhVersion\": \"1.37\",\n", " \"benchmark\": \"test.CompareHypothesis.invSqrtBaseline\",\n", " \"mode\": \"thrpt\",\n", " \"threads\": 1,\n", " \"forks\": 1,\n", " \"jvm\": \"/Users/filipp.zhinkin/.gradle/jdks/amazon_com_inc_-8-aarch64-os_x/amazon-corretto-8.jdk/Contents/Home/jre/bin/java\",\n", " \"jvmArgs\": [\n", " \"-Dfile.encoding=UTF-8\",\n", " \"-Duser.country=US\",\n", " \"-Duser.language=en\",\n", " \"-Duser.variant\"\n", " ],\n", " \"jdkVersion\": \"1.8.0_422\",\n", " \"vmName\": \"OpenJDK 64-Bit Server VM\",\n", " \"vmVersion\": \"25.422-b05\",\n", " \"warmupIterations\": 3,\n", " \"warmupTime\": \"5 s\",\n", " \"warmupBatchSize\": 1,\n", " \"measurementIterations\": 3,\n", " \"measurementTime\": \"5 s\",\n", " \"measurementBatchSize\": 1,\n", " \"primaryMetric\": {\n", " \"score\": 8.203977554632516E8,\n", " \"scoreError\": 1.1337770231189007E7,\n", " \"scoreConfidence\": [\n", " 8.090599852320626E8,\n", " 8.317355256944406E8\n", " ],\n", " \"scorePercentiles\": {\n", " \"0.0\": 8.197133288452934E8,\n", " \"50.0\": 8.205531948987743E8,\n", " \"90.0\": 8.209267426456873E8,\n", " \"95.0\": 8.209267426456873E8,\n", " \"99.0\": 8.209267426456873E8,\n", " \"99.9\": 8.209267426456873E8,\n", " \"99.99\": 8.209267426456873E8,\n", " \"99.999\": 8.209267426456873E8,\n", " \"99.9999\": 8.209267426456873E8,\n", " \"100.0\": 8.209267426456873E8\n", " },\n", " \"scoreUnit\": \"ops/s\",\n", " \"rawData\": [\n", " [\n", " 8.197133288452934E8,\n", " 8.209267426456873E8,\n", " 8.205531948987743E8\n", " ]\n", " ]\n", " },\n", " \"secondaryMetrics\": {}\n", " },\n", " {\n", " \"jmhVersion\": \"1.37\",\n", " \"benchmark\": \"test.CompareHypothesis.invSqrtOptimized\",\n", " \"mode\": \"thrpt\",\n", " \"threads\": 1,\n", " \"forks\": 1,\n", " \"jvm\": \"/Users/filipp.zhinkin/.gradle/jdks/amazon_com_inc_-8-aarch64-os_x/amazon-corretto-8.jdk/Contents/Home/jre/bin/java\",\n", " \"jvmArgs\": [\n", " \"-Dfile.encoding=UTF-8\",\n", " \"-Duser.country=US\",\n", " \"-Duser.language=en\",\n", " \"-Duser.variant\"\n", " ],\n", " \"jdkVersion\": \"1.8.0_422\",\n", " \"vmName\": \"OpenJDK 64-Bit Server VM\",\n", " \"vmVersion\": \"25.422-b05\",\n", " \"warmupIterations\": 3,\n", " \"warmupTime\": \"5 s\",\n", " \"warmupBatchSize\": 1,\n", " \"measurementIterations\": 3,\n", " \"measurementTime\": \"5 s\",\n", " \"measurementBatchSize\": 1,\n", " \"primaryMetric\": {\n", " \"score\": 6.561712309456968E8,\n", " \"scoreError\": 1.06182674607018E7,\n", " \"scoreConfidence\": [\n", " 6.45552963484995E8,\n", " 6.667894984063987E8\n", " ],\n", " \"scorePercentiles\": {\n", " \"0.0\": 6.55560459019124E8,\n", " \"50.0\": 6.562337813814477E8,\n", " \"90.0\": 6.567194524365189E8,\n", " \"95.0\": 6.567194524365189E8,\n", " \"99.0\": 6.567194524365189E8,\n", " \"99.9\": 6.567194524365189E8,\n", " \"99.99\": 6.567194524365189E8,\n", " \"99.999\": 6.567194524365189E8,\n", " \"99.9999\": 6.567194524365189E8,\n", " \"100.0\": 6.567194524365189E8\n", " },\n", " \"scoreUnit\": \"ops/s\",\n", " \"rawData\": [\n", " [\n", " 6.567194524365189E8,\n", " 6.562337813814477E8,\n", " 6.55560459019124E8\n", " ]\n", " ]\n", " },\n", " \"secondaryMetrics\": {}\n", " }\n", "]" ],
"text/markdown" : "```json\n[\n {\n \"jmhVersion\": \"1.37\",\n \"benchmark\": \"test.CompareHypothesis.invSqrtBaseline\",\n \"mode\": \"thrpt\",\n \"threads\": 1,\n \"forks\": 1,\n \"jvm\": \"/Users/filipp.zhinkin/.gradle/jdks/amazon_com_inc_-8-aarch64-os_x/amazon-corretto-8.jdk/Contents/Home/jre/bin/java\",\n \"jvmArgs\": [\n \"-Dfile.encoding=UTF-8\",\n \"-Duser.country=US\",\n \"-Duser.language=en\",\n \"-Duser.variant\"\n ],\n \"jdkVersion\": \"1.8.0_422\",\n \"vmName\": \"OpenJDK 64-Bit Server VM\",\n \"vmVersion\": \"25.422-b05\",\n \"warmupIterations\": 3,\n \"warmupTime\": \"5 s\",\n \"warmupBatchSize\": 1,\n \"measurementIterations\": 3,\n \"measurementTime\": \"5 s\",\n \"measurementBatchSize\": 1,\n \"primaryMetric\": {\n \"score\": 8.203977554632516E8,\n \"scoreError\": 1.1337770231189007E7,\n \"scoreConfidence\": [\n 8.090599852320626E8,\n 8.317355256944406E8\n ],\n \"scorePercentiles\": {\n \"0.0\": 8.197133288452934E8,\n \"50.0\": 8.205531948987743E8,\n \"90.0\": 8.209267426456873E8,\n \"95.0\": 8.209267426456873E8,\n \"99.0\": 8.209267426456873E8,\n \"99.9\": 8.209267426456873E8,\n \"99.99\": 8.209267426456873E8,\n \"99.999\": 8.209267426456873E8,\n \"99.9999\": 8.209267426456873E8,\n \"100.0\": 8.209267426456873E8\n },\n \"scoreUnit\": \"ops/s\",\n \"rawData\": [\n [\n 8.197133288452934E8,\n 8.209267426456873E8,\n 8.205531948987743E8\n ]\n ]\n },\n \"secondaryMetrics\": {}\n },\n {\n \"jmhVersion\": \"1.37\",\n \"benchmark\": \"test.CompareHypothesis.invSqrtOptimized\",\n \"mode\": \"thrpt\",\n \"threads\": 1,\n \"forks\": 1,\n \"jvm\": \"/Users/filipp.zhinkin/.gradle/jdks/amazon_com_inc_-8-aarch64-os_x/amazon-corretto-8.jdk/Contents/Home/jre/bin/java\",\n \"jvmArgs\": [\n \"-Dfile.encoding=UTF-8\",\n \"-Duser.country=US\",\n \"-Duser.language=en\",\n \"-Duser.variant\"\n ],\n \"jdkVersion\": \"1.8.0_422\",\n \"vmName\": \"OpenJDK 64-Bit Server VM\",\n \"vmVersion\": \"25.422-b05\",\n \"warmupIterations\": 3,\n \"warmupTime\": \"5 s\",\n \"warmupBatchSize\": 1,\n \"measurementIterations\": 3,\n \"measurementTime\": \"5 s\",\n \"measurementBatchSize\": 1,\n \"primaryMetric\": {\n \"score\": 6.561712309456968E8,\n \"scoreError\": 1.06182674607018E7,\n \"scoreConfidence\": [\n 6.45552963484995E8,\n 6.667894984063987E8\n ],\n \"scorePercentiles\": {\n \"0.0\": 6.55560459019124E8,\n \"50.0\": 6.562337813814477E8,\n \"90.0\": 6.567194524365189E8,\n \"95.0\": 6.567194524365189E8,\n \"99.0\": 6.567194524365189E8,\n \"99.9\": 6.567194524365189E8,\n \"99.99\": 6.567194524365189E8,\n \"99.999\": 6.567194524365189E8,\n \"99.9999\": 6.567194524365189E8,\n \"100.0\": 6.567194524365189E8\n },\n \"scoreUnit\": \"ops/s\",\n \"rawData\": [\n [\n 6.567194524365189E8,\n 6.562337813814477E8,\n 6.55560459019124E8\n ]\n ]\n },\n \"secondaryMetrics\": {}\n }\n]\n```"
},
"execution_count" : 5,
"metadata" : {
"application/json" : {
"expanded" : true
}
},
"output_type" : "execute_result"
} ],
"execution_count" : 5
}, {
"metadata" : {
"executionRelatedData" : {
"compiledClasses" : [ "Line_19_jupyter", "Line_26_jupyter", "Line_28_jupyter" ]
},
"ExecuteTime" : {
"end_time" : "2025-10-31T12:34:15.990686Z",
"start_time" : "2025-10-31T12:34:15.903612Z"
}
},
"cell_type" : "code",
"source" : [ "// Helper class for tracking the information we need to use.\n", "data class Benchmark(val name: String, val params: String, val score: Double, val error: Double, val unit: String)\n", "\n", "// Split benchmark results into groups. Generally, each group consist of all tests from one test file,\n", "// except when it is an parameterized test. In this case, each test (with all its variants) are put\n", "// in its own group.\n", "val benchmarkGroups = benchmarkData\n", " .groupBy {\n", " it.benchmark.substringBeforeLast(\".\")\n", " }\n", " .mapValues { group ->\n", " val benchmarks = group.value.map { benchmark ->\n", " // Parameters are specific to each test. `deserializeJson()` will generate the appropriate data classes,\n", " // but for generic handling of parameters we would need to fallback to reading the JSON. In this case\n", " // we just handle them through the typed API.\n", " val name = benchmark.benchmark\n", " Benchmark(\n", " name,\n", " \"\",\n", " benchmark.primaryMetric.score,\n", " benchmark.primaryMetric.scoreError,\n", " benchmark.primaryMetric.scoreUnit\n", " )\n", " }\n", " benchmarks.toDataFrame()\n", " }\n", "\n", "// Un-commont this to see the benchmark data as DataFrames\n", "// benchmarkGroups.forEach {\n", "// DISPLAY(it.value)\n", "// }" ],
"id" : "bd07e04dee81abb5",
"outputs" : [ ],
"execution_count" : 9
}, {
"metadata" : {
"executionRelatedData" : {
"compiledClasses" : [ "Line_20_jupyter", "Line_29_jupyter" ]
},
"ExecuteTime" : {
"end_time" : "2025-10-31T12:34:17.820533Z",
"start_time" : "2025-10-31T12:34:17.681196Z"
}
},
"cell_type" : "code",
"source" : [ "// Prepare the data frames for plotting by:\n", "// - Add calculated columns for errorMin / errorMax\n", "// - Tests with parameters use the parameter values as the label\n", "// - Tests without paramaters use the test name as the label\n", "val plotData = benchmarkGroups.mapValues {\n", " it.value\n", " .add(\"errorMin\") { it.getValue<Double>(\"score\") - it.getValue<Double>(\"error\") }\n", " .add(\"errorMax\") { it.getValue<Double>(\"score\") + it.getValue<Double>(\"error\") }\n", " .insert(\"label\") {\n", " // Re-format the benchmark labels to make them look \"nicer\"\n", " if (!it.getValue<String>(\"params\").isBlank()) {\n", " it.getValue<String>(\"params\").replace(\",\", \"\\n\")\n", " } else {\n", " it.getValue<String>(\"name\").substringAfterLast(\".\").removeSuffix(\"Benchmark\")\n", " }\n", " }.at(0)\n", " .remove(\"name\", \"params\")\n", "}" ],
"id" : "944385e54b413d31",
"outputs" : [ ],
"execution_count" : 10
}, {
"metadata" : {
"executionRelatedData" : {
"compiledClasses" : [ "Line_21_jupyter", "Line_30_jupyter", "Line_31_jupyter" ]
},
"ExecuteTime" : {
"end_time" : "2025-10-31T12:34:24.014077Z",
"start_time" : "2025-10-31T12:34:23.874298Z"
}
},
"cell_type" : "code",
"source" : [ "import org.jetbrains.letsPlot.Geom\n", "import org.jetbrains.letsPlot.core.spec.plotson.coord\n", "import org.jetbrains.letsPlot.themes.margin\n", "\n", "// Plot each group as a bar plot with the error displayed as error bars.\n", "// This approach assumes that each group has tests roughly within the same \"scale\".\n", "// If this is not the case, some plots might look very squished. If this happens,\n", "// you can play around with using a LOG10 scale or modifying the limits to focus\n", "// on the changes.\n", "plotData.forEach { (fileName, dataframe) ->\n", " val plot = dataframe.plot {\n", " bars {\n", " x(\"label\") {\n", " axis.name = \"\"\n", " }\n", " y(\"score\")\n", " }\n", " errorBars {\n", " x(\"label\")\n", " y(\"score\")\n", " yMin(\"errorMin\")\n", " yMax(\"errorMax\")\n", " }\n", " coordinatesTransformation = CoordinatesTransformation.cartesianFlipped()\n", " // y.axis.limits = dataframe.min(\"errorMin\")..dataframe.max(\"errorMax\")\n", " layout {\n", " this.yAxisLabel = dataframe.first().getValue<String>(\"unit\")\n", " style {\n", " global {\n", " title {\n", " margin(10.0, 0.0)\n", " }\n", " text {\n", " fontFamily = FontFamily.MONO\n", " }\n", " }\n", " }\n", " // Adjust the height of the Kandy plot based on the number of tests.\n", " size = 800 to ((50 * dataframe.size().nrow) + 100)\n", " }\n", " }\n", " DISPLAY(HTML(\"<h4 >$fileName</h4>\"))\n", " DISPLAY(plot)\n", "}" ],
"id" : "6530d00c90a41a46",
"outputs" : [ {
"data" : {
"text/html" : [ "<h4 >test.CompareHypothesis</h4>" ]
},
"metadata" : { },
"output_type" : "display_data",
"jetTransient" : {
"display_id" : null
}
}, {
"data" : {
"text/html" : [ " <iframe src='about:blank' style='border:none !important;' width='800' height='200' srcdoc=\"&lt;html lang=&quot;en&quot;>\n", " &lt;head>\n", " &lt;meta charset=&quot;UTF-8&quot;>\n", " &lt;style> html, body { margin: 0; padding: 0; overflow: hidden; } &lt;/style>\n", " &lt;script type=&quot;text/javascript&quot; data-lets-plot-script=&quot;library&quot; src=&quot;https://cdn.jsdelivr.net/gh/JetBrains/[email protected]/js-package/distr/lets-plot.min.js&quot;>&lt;/script>\n", " &lt;/head>\n", " &lt;body>\n", " &lt;div id=&quot;mnLLj5&quot;>&lt;/div>\n", " &lt;script type=&quot;text/javascript&quot; data-lets-plot-script=&quot;plot&quot;>\n", " \n", " (function() {\n", " // ----------\n", " \n", " const forceImmediateRender = false;\n", " const responsive = false;\n", " \n", " let sizing = {\n", " width_mode: &quot;FIXED&quot;,\n", " height_mode: &quot;FIXED&quot;,\n", " width: 800.0, \n", " height: 200.0 \n", " };\n", " \n", " const preferredWidth = document.body.dataset.letsPlotPreferredWidth;\n", " if (preferredWidth !== undefined) {\n", " sizing = {\n", " width_mode: 'FIXED',\n", " height_mode: 'SCALED',\n", " width: parseFloat(preferredWidth)\n", " };\n", " }\n", " \n", " const containerDiv = document.getElementById(&quot;mnLLj5&quot;);\n", " let fig = null;\n", " \n", " function renderPlot() {\n", " if (fig === null) {\n", " const plotSpec = {\n", "&quot;mapping&quot;:{\n", "},\n", "&quot;guides&quot;:{\n", "&quot;y&quot;:{\n", "&quot;title&quot;:&quot;ops/s&quot;\n", "}\n", "},\n", "&quot;coord&quot;:{\n", "&quot;name&quot;:&quot;flip&quot;,\n", "&quot;flip&quot;:true\n", "},\n", "&quot;data&quot;:{\n", "&quot;score&quot;:[8.203977554632516E8,6.561712309456968E8],\n", "&quot;errorMax&quot;:[8.317355256944406E8,6.667894984063987E8],\n", "&quot;label&quot;:[&quot;invSqrtBaseline&quot;,&quot;invSqrtOptimized&quot;],\n", "&quot;errorMin&quot;:[8.090599852320626E8,6.45552963484995E8]\n", "},\n", "&quot;ggsize&quot;:{\n", "&quot;width&quot;:800.0,\n", "&quot;height&quot;:200.0\n", "},\n", "&quot;kind&quot;:&quot;plot&quot;,\n", "&quot;scales&quot;:[{\n", "&quot;aesthetic&quot;:&quot;y&quot;,\n", "&quot;limits&quot;:[null,null]\n", "},{\n", "&quot;aesthetic&quot;:&quot;x&quot;,\n", "&quot;discrete&quot;:true,\n", "&quot;name&quot;:&quot;&quot;\n", "},{\n", "&quot;aesthetic&quot;:&quot;y&quot;,\n", "&quot;limits&quot;:[null,null]\n", "},{\n", "&quot;aesthetic&quot;:&quot;x&quot;,\n", "&quot;discrete&quot;:true\n", "}],\n", "&quot;layers&quot;:[{\n", "&quot;mapping&quot;:{\n", "&quot;y&quot;:&quot;score&quot;,\n", "&quot;x&quot;:&quot;label&quot;\n", "},\n", "&quot;stat&quot;:&quot;identity&quot;,\n", "&quot;sampling&quot;:&quot;none&quot;,\n", "&quot;inherit_aes&quot;:false,\n", "&quot;position&quot;:&quot;dodge&quot;,\n", "&quot;geom&quot;:&quot;bar&quot;,\n", "&quot;data&quot;:{\n", "}\n", "},{\n", "&quot;mapping&quot;:{\n", "&quot;y&quot;:&quot;score&quot;,\n", "&quot;x&quot;:&quot;label&quot;,\n", "&quot;ymin&quot;:&quot;errorMin&quot;,\n", "&quot;ymax&quot;:&quot;errorMax&quot;\n", "},\n", "&quot;stat&quot;:&quot;identity&quot;,\n", "&quot;sampling&quot;:&quot;none&quot;,\n", "&quot;inherit_aes&quot;:false,\n", "&quot;position&quot;:&quot;dodge&quot;,\n", "&quot;geom&quot;:&quot;errorbar&quot;,\n", "&quot;data&quot;:{\n", "}\n", "}],\n", "&quot;theme&quot;:{\n", "&quot;text&quot;:{\n", "&quot;family&quot;:&quot;mono&quot;,\n", "&quot;blank&quot;:false\n", "},\n", "&quot;title&quot;:{\n", "&quot;margin&quot;:[10.0,0.0,10.0,0.0],\n", "&quot;blank&quot;:false\n", "},\n", "&quot;axis_ontop&quot;:false,\n", "&quot;axis_ontop_y&quot;:false,\n", "&quot;axis_ontop_x&quot;:false\n", "},\n", "&quot;data_meta&quot;:{\n", "&quot;series_annotations&quot;:[{\n", "&quot;type&quot;:&quot;str&quot;,\n", "&quot;column&quot;:&quot;label&quot;\n", "},{\n", "&quot;type&quot;:&quot;float&quot;,\n", "&quot;column&quot;:&quot;score&quot;\n", "},{\n", "&quot;type&quot;:&quot;float&quot;,\n", "&quot;column&quot;:&quot;errorMin&quot;\n", "},{\n", "&quot;type&quot;:&quot;float&quot;,\n", "&quot;column&quot;:&quot;errorMax&quot;\n", "}]\n", "},\n", "&quot;spec_id&quot;:&quot;5&quot;\n", "};\n", " fig = LetsPlot.buildPlotFromProcessedSpecs(plotSpec, containerDiv, sizing);\n", " } else {\n", " fig.updateView({});\n", " }\n", " }\n", " \n", " const renderImmediately = \n", " forceImmediateRender || (\n", " sizing.width_mode === 'FIXED' &amp;&amp; \n", " (sizing.height_mode === 'FIXED' || sizing.height_mode === 'SCALED')\n", " );\n", " \n", " if (renderImmediately) {\n", " renderPlot();\n", " }\n", " \n", " if (!renderImmediately || responsive) {\n", " // Set up observer for initial sizing or continuous monitoring\n", " var observer = new ResizeObserver(function(entries) {\n", " for (let entry of entries) {\n", " if (entry.contentBoxSize &amp;&amp; \n", " entry.contentBoxSize[0].inlineSize > 0) {\n", " if (!responsive &amp;&amp; observer) {\n", " observer.disconnect();\n", " observer = null;\n", " }\n", " renderPlot();\n", " if (!responsive) {\n", " break;\n", " }\n", " }\n", " }\n", " });\n", " \n", " observer.observe(containerDiv);\n", " }\n", " \n", " // ----------\n", " })();\n", " \n", " &lt;/script>\n", " &lt;/body>\n", "&lt;/html>\"></iframe> <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" display=\"block\" class=\"plt-container\" id=29187dd2-7767-41f9-87ea-b1ac0744fe6b width=\"100%\" height=\"100%\" style=\"max-width: 800.0px; max-height: 200.0px;\" viewBox=\"0 0 800.0 200.0\" preserveAspectRatio=\"xMinYMin meet\">\n", " <style type=\"text/css\">\n", " .plt-container {\n", " font-family: sans-serif;\n", " user-select: none;\n", " -webkit-user-select: none;\n", " -moz-user-select: none;\n", " -ms-user-select: none;\n", "}\n", "text {\n", " text-rendering: optimizeLegibility;\n", "}\n", "#puD7vQk .plot-title {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 16.0px;\n", "\n", "}\n", "#puD7vQk .plot-subtitle {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 15.0px;\n", "\n", "}\n", "#puD7vQk .plot-caption {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#puD7vQk .hyperlink-element {\n", "fill: #118ed8;\n", "font-weight: normal;\n", " font-style: normal;\n", "}\n", "#puD7vQk .legend-title {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 15.0px;\n", "\n", "}\n", "#puD7vQk .legend-item {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#puD7vQk .axis-title-y {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 15.0px;\n", "\n", "}\n", "#puD7vQk .axis-text-y {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dRMBS7f .axis-tooltip-text-y {\n", "fill: #ffffff;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#puD7vQk .axis-title-x {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 15.0px;\n", "\n", "}\n", "#puD7vQk .axis-text-x {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dRMBS7f .axis-tooltip-text-x {\n", "fill: #ffffff;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#puD7vQk .facet-strip-text-x {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#puD7vQk .facet-strip-text-y {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dRMBS7f .tooltip-text {\n", "fill: #474747;\n", "font-weight: normal;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dRMBS7f .tooltip-title {\n", "fill: #474747;\n", "font-weight: bold;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "#dRMBS7f .tooltip-label {\n", "fill: #474747;\n", "font-weight: bold;\n", " font-style: normal;font-family: mono;\n", "font-size: 13.0px;\n", "\n", "}\n", "\n", " </style>\n", " <g id=\"puD7vQk\">\n", " <path fill-rule=\"evenodd\" fill=\"rgb(255,255,255)\" fill-opacity=\"1.0\" d=\"M0.0 0.0 L0.0 200.0 L800.0 200.0 L800.0 0.0 Z\">\n", " </path>\n", " <g transform=\"translate(21.0 6.0 ) \">\n", " <g>\n", " <g transform=\"translate(124.88370084186325 0.0 ) \">\n", " <g>\n", " <line x1=\"0.0\" y1=\"0.0\" x2=\"0.0\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"74.21272738476345\" y1=\"0.0\" x2=\"74.21272738476345\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"148.4254547695269\" y1=\"0.0\" x2=\"148.4254547695269\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"222.63818215429038\" y1=\"0.0\" x2=\"222.63818215429038\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"296.8509095390538\" y1=\"0.0\" x2=\"296.8509095390538\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"371.0636369238173\" y1=\"0.0\" x2=\"371.0636369238173\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"445.27636430858075\" y1=\"0.0\" x2=\"445.27636430858075\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"519.4890916933442\" y1=\"0.0\" x2=\"519.4890916933442\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"593.7018190781076\" y1=\"0.0\" x2=\"593.7018190781076\" y2=\"138.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " </g>\n", " </g>\n", " <g transform=\"translate(124.88370084186325 0.0 ) \">\n", " <g>\n", " <line x1=\"0.0\" y1=\"99.0\" x2=\"648.1162991581367\" y2=\"99.0\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " <line x1=\"0.0\" y1=\"38.99999999999999\" x2=\"648.1162991581367\" y2=\"38.99999999999999\" stroke=\"rgb(233,233,233)\" stroke-opacity=\"1.0\" stroke-width=\"1.0\" fill=\"none\">\n", " </line>\n", " </g>\n", " </g>\n", " <g transform=\"translate(124.88370084186325 138.0 ) \">\n", " <g transform=\"translate(0.0 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>0</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(74.21272738476345 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>1e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(148.4254547695269 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>2e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(222.63818215429038 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>3e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(296.8509095390538 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>4e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(371.0636369238173 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>5e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(445.27636430858075 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>6e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(519.4890916933442 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>7e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(593.7018190781076 0.0 ) \">\n", " <g transform=\"translate(0.0 2.0 ) \">\n", " <text class=\"axis-text-y\" text-anchor=\"middle\" dy=\"0.7em\" y=\"0.0\">\n", " <tspan>8e+8</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " </g>\n", " <g transform=\"translate(124.88370084186325 0.0 ) \">\n", " <g transform=\"translate(0.0 99.0 ) \">\n", " <line stroke-width=\"1.0\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text class=\"axis-text-x\" text-anchor=\"end\" dy=\"0.35em\" y=\"0.0\">\n", " <tspan>invSqrtBaseline</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <g transform=\"translate(0.0 38.99999999999999 ) \">\n", " <line stroke-width=\"1.0\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" x2=\"-4.0\" y2=\"0.0\">\n", " </line>\n", " <g transform=\"translate(-6.0 0.0 ) \">\n", " <text class=\"axis-text-x\" text-anchor=\"end\" dy=\"0.35em\" y=\"0.0\">\n", " <tspan>invSqrtOptimized</tspan>\n", " </text>\n", " </g>\n", " </g>\n", " <line x1=\"0.0\" y1=\"0.0\" x2=\"0.0\" y2=\"138.0\" stroke-width=\"1.0\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\">\n", " </line>\n", " </g>\n", " </g>\n", " <g clip-path=\"url(#cnsdZq6)\" clip-bounds-jfx=\"[rect (124.88370084186325, 0.0), (648.1162991581367, 138.0)]\">\n", " <g transform=\"translate(124.88370084186325 0.0 ) \">\n", " <g>\n", " <g>\n", " <rect x=\"0.0\" y=\"11.999999999999986\" height=\"54.000000000000014\" width=\"486.9625667989766\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" fill=\"rgb(17,142,216)\" fill-opacity=\"1.0\" stroke-width=\"1.6500000000000001\">\n", " </rect>\n", " <rect x=\"0.0\" y=\"72.0\" height=\"54.0\" width=\"608.8395497326612\" stroke=\"rgb(255,255,255)\" stroke-opacity=\"1.0\" fill=\"rgb(17,142,216)\" fill-opacity=\"1.0\" stroke-width=\"1.6500000000000001\">\n", " </rect>\n", " </g>\n", " <g>\n", " <g>\n", " <line x1=\"600.4254812194781\" y1=\"112.5\" x2=\"600.4254812194781\" y2=\"85.5\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" fill=\"none\" stroke-width=\"1.6500000000000001\">\n", " </line>\n", " <line x1=\"617.2536182458445\" y1=\"112.5\" x2=\"617.2536182458445\" y2=\"85.5\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" fill=\"none\" stroke-width=\"1.6500000000000001\">\n", " </line>\n", " <line x1=\"600.4254812194781\" y1=\"99.0\" x2=\"617.2536182458445\" y2=\"99.0\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" fill=\"none\" stroke-width=\"1.6500000000000001\">\n", " </line>\n", " </g>\n", " <g>\n", " <line x1=\"479.0824609153809\" y1=\"52.49999999999999\" x2=\"479.0824609153809\" y2=\"25.499999999999986\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" fill=\"none\" stroke-width=\"1.6500000000000001\">\n", " </line>\n", " <line x1=\"494.8426726825723\" y1=\"52.49999999999999\" x2=\"494.8426726825723\" y2=\"25.499999999999986\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" fill=\"none\" stroke-width=\"1.6500000000000001\">\n", " </line>\n", " <line x1=\"479.0824609153809\" y1=\"38.99999999999999\" x2=\"494.8426726825723\" y2=\"38.99999999999999\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" fill=\"none\" stroke-width=\"1.6500000000000001\">\n", " </line>\n", " </g>\n", " </g>\n", " </g>\n", " </g>\n", " <defs>\n", " <clipPath id=\"c5vy0mk\">\n", " <rect x=\"124.88370084186325\" y=\"0.0\" width=\"648.1162991581367\" height=\"138.0\">\n", " </rect>\n", " </clipPath>\n", " </defs>\n", " <defs>\n", " <clipPath id=\"cnsdZq6\">\n", " <rect x=\"124.88370084186325\" y=\"0.0\" width=\"648.1162991581367\" height=\"138.0\">\n", " </rect>\n", " </clipPath>\n", " </defs>\n", " </g>\n", " <g>\n", " </g>\n", " </g>\n", " <g transform=\"translate(15.0 75.0 ) rotate(-90.0 ) \">\n", " </g>\n", " <g transform=\"translate(469.9418504209316 184.0 ) \">\n", " <text class=\"axis-title-y\" y=\"0.0\" text-anchor=\"middle\">\n", " <tspan>ops/s</tspan>\n", " </text>\n", " </g>\n", " <path fill=\"rgb(0,0,0)\" fill-opacity=\"0.0\" stroke=\"rgb(71,71,71)\" stroke-opacity=\"1.0\" stroke-width=\"0.0\" d=\"M0.0 0.0 L0.0 200.0 L800.0 200.0 L800.0 0.0 Z\" pointer-events=\"none\">\n", " </path>\n", " </g>\n", " <g id=\"dRMBS7f\">\n", " </g>\n", "</svg>\n", " <script>document.getElementById(\"29187dd2-7767-41f9-87ea-b1ac0744fe6b\").style.display = \"none\";</script>" ],
"application/plot+json" : {
"output_type" : "lets_plot_spec",
"output" : {
"mapping" : { },
"guides" : {
"y" : {
"title" : "ops/s"
}
},
"coord" : {
"name" : "flip",
"flip" : true
},
"data" : {
"score" : [ 8.203977554632516E8, 6.561712309456968E8 ],
"errorMax" : [ 8.317355256944406E8, 6.667894984063987E8 ],
"label" : [ "invSqrtBaseline", "invSqrtOptimized" ],
"errorMin" : [ 8.090599852320626E8, 6.45552963484995E8 ]
},
"ggsize" : {
"width" : 800.0,
"height" : 200.0
},
"kind" : "plot",
"scales" : [ {
"aesthetic" : "y",
"limits" : [ null, null ]
}, {
"aesthetic" : "x",
"discrete" : true,
"name" : ""
}, {
"aesthetic" : "y",
"limits" : [ null, null ]
}, {
"aesthetic" : "x",
"discrete" : true
} ],
"layers" : [ {
"mapping" : {
"y" : "score",
"x" : "label"
},
"stat" : "identity",
"sampling" : "none",
"inherit_aes" : false,
"position" : "dodge",
"geom" : "bar"
}, {
"mapping" : {
"y" : "score",
"x" : "label",
"ymin" : "errorMin",
"ymax" : "errorMax"
},
"stat" : "identity",
"sampling" : "none",
"inherit_aes" : false,
"position" : "dodge",
"geom" : "errorbar"
} ],
"theme" : {
"text" : {
"family" : "mono",
"blank" : false
},
"title" : {
"margin" : [ 10.0, 0.0, 10.0, 0.0 ],
"blank" : false
},
"axis_ontop" : false,
"axis_ontop_y" : false,
"axis_ontop_x" : false
},
"data_meta" : {
"series_annotations" : [ {
"type" : "str",
"column" : "label"
}, {
"type" : "float",
"column" : "score"
}, {
"type" : "float",
"column" : "errorMin"
}, {
"type" : "float",
"column" : "errorMax"
} ]
}
},
"apply_color_scheme" : true,
"swing_enabled" : true
}
},
"metadata" : { },
"output_type" : "display_data",
"jetTransient" : {
"display_id" : null
}
} ],
"execution_count" : 12
} ],
"metadata" : {
"kernelspec" : {
"display_name" : "Kotlin",
"language" : "kotlin",
"name" : "kotlin"
},
"language_info" : {
"name" : "kotlin",
"version" : "2.2.20",
"mimetype" : "text/x-kotlin",
"file_extension" : ".kt",
"pygments_lexer" : "kotlin",
"codemirror_mode" : "text/x-kotlin",
"nbconvert_exporter" : ""
}
},
"nbformat" : 4,
"nbformat_minor" : 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment