SynthBenchmark A class for using NRT mode to benchmark synths by their time taken.



REQUIRES GNU TIME COMMAND - on macports it's the gtime package, "sudo port install gtime".

On linux it's probably available from yr package manager e.g. "sudo apt-get install time".


Just run this to make it happen - on my system it takes about a minute to run:


SynthBenchmark().run(false);


The output shows the CPU time (not the wallclock time) taken to execute each of the files in Non-Realtime-Synthesis mode, thus giving some numeric indication of how efficient scsynth and its plugins are on your current setup. NRT mode is not the same as realtime mode but it's much easier to measure and is likely to give a good indication.


You can write your own benchmarks if you like. In the quark there's a "benchmarks" folder containing files named *_bench.scd - all files of that form are expected to contain sclang code to define a SynthDef (note that they don't .load or .store the SynthDef, they just return it). You can define benchmarks in different folders, and then pass the folder paths in as an argument to the SynthBenchmark() constructor.




// The "compare" method returns a string with stats comparing two runs:

a = SynthBenchmark().run(false);

// ...then recompile scsynth or whatever change you want to make...

b = SynthBenchmark().run(false);

compare(a, b);