These are scripts for benchmarking Blender features on real-world .blend files. They were originally written for benchmarking Cycles performance, and were made generic so they can be used for more Blender features. The benchmarks can be run locally by developers. But the plan is to also run these as part of continuous integration to track performance over time. Currently there are tests for Cycles rendering and .blend file loading. Documentation: https://wiki.blender.org/wiki/Tools/Tests/Performance Main features: * User created configurations to quickly run, re-run and analyze a selected subset of tests. * Supports both benchmarking with existing builds, and automatic building of specified git commits, tags and branches. * Generate HTML page with bar and line graphs from test results. * Controlled using simple command line tool. * For writing tests, convenient abstraction to run a Python function in Blender with arguments and return value. Ref T74730 Differential Revision: https://developer.blender.org/D11662
87 lines
2.5 KiB
HTML
87 lines
2.5 KiB
HTML
<html>
|
|
<head>
|
|
<title>Benchmarks</title>
|
|
<meta charset="UTF-8">
|
|
<style type="text/css">
|
|
body { margin: 40px auto;
|
|
font-family: Arial;
|
|
font-size: 14px;
|
|
color: #333;
|
|
max-width: 900px; }
|
|
a { text-decoration: none; color: #06b; }
|
|
</style>
|
|
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
|
<script>
|
|
google.charts.load('current', {'packages':['line', 'bar']});
|
|
google.charts.setOnLoadCallback(draw_charts);
|
|
|
|
function transposeDataTable(dt)
|
|
{
|
|
/* Swap rows and columns. Bar and line charts expect different layouts,
|
|
* with this function we can use the same data source for both. */
|
|
var ndt = new google.visualization.DataTable;
|
|
ndt.addColumn('string',dt.getColumnLabel(0));
|
|
for(var x=1; x<dt.getNumberOfColumns(); x++) {
|
|
ndt.addRow([dt.getColumnLabel(x)]);
|
|
}
|
|
for(var x=0; x<dt.getNumberOfRows(); x++) {
|
|
ndt.addColumn('number', dt.getValue(x,0));
|
|
for(var y=1; y<dt.getNumberOfColumns(); y++) {
|
|
ndt.setValue(y-1, x+1, dt.getValue(x,y));
|
|
}
|
|
}
|
|
return ndt;
|
|
}
|
|
|
|
function draw_charts()
|
|
{
|
|
/* Load JSON data. */
|
|
var json_data = %JSON_DATA%;
|
|
|
|
/* Clear contents. */
|
|
charts_elem = document.getElementById("charts");
|
|
while(charts_elem.firstChild)
|
|
{
|
|
charts_elem.removeChild(charts_elem.firstChild);
|
|
}
|
|
|
|
/* Draw charts for each device. */
|
|
for (var i = 0; i < json_data.length; i++)
|
|
{
|
|
device = json_data[i];
|
|
|
|
/* Chart drawing options. */
|
|
var options = {
|
|
chart: {title: device["category"], subtitle: device['device']},
|
|
pointsVisible: true,
|
|
pointSize: 2.5,
|
|
height: 500,
|
|
};
|
|
|
|
/* Create chart div. */
|
|
elem = document.createElement('div');
|
|
elem.id = device["id"];
|
|
charts_elem.appendChild(elem)
|
|
|
|
/* Create chart. */
|
|
var data = new google.visualization.DataTable(device["data"]);
|
|
if (device['chart_type'] == 'line') {
|
|
var chart = new google.charts.Line(elem);
|
|
chart.draw(data, options);
|
|
}
|
|
else {
|
|
var chart = new google.charts.Bar(elem);
|
|
chart.draw(transposeDataTable(data), options);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>Benchmarks</h1>
|
|
<div id="charts">
|
|
...
|
|
</div>
|
|
</body>
|
|
</html>
|