Expression Benchmark

4 votes
Date Updated: 
Author Name: 
Ian Adams

Expression Benchmark is a script for diagnosing multiple expressions for speed and memory usage. Each expression shows a resulting executing time and memory size, at the same time showing what the expression returned.  Each expression also has the option to turn redraw and undo, on or off for the duration of each expression.  Expressions can be ran multiple times with the Iterations parameter, resulting in an average for execution time and memory usage.  There is also an option to perform auto garbage collection, manual garbage collection, and perform garbage collection in between each expression.  You can also change the time and memory units.

Can especially be useful for evaluating multple functions, instead of needing the listener, and seeing how fast they are after optimizing them.

Includes two macroscripts, one which is used for evaluating ten single-line expressions, and one for evaluating 3 multi-line expressions.

Usage - Run macroscript file, and use customize user interface to lauch the macros from the IA Extensions category.

Update 1.01 - Added buttons to execute individual expressions.  Total times and memories are added from the executed expression and from existing expressions.

Update 1.02 - Clicking on any execute expression buttons now resets the values for the expression's time, memory, and result, if the expression is empty.  Executing all expressions, also resets values for any empty expressions.

Update 1.03 - Added error handling.  When there is an error in the expression, the macroscript no longer gets broken, requiring the macroscript to be reopen.  Instead the error gets printed to the listener.

Update 1.04 - Limited the width of each expression's result, which used to cause lag if the result was really long.

Update 1.05 - Added buttons to copy each expression's result to the clipboard.

Update 1.06 - Optimized general code, and fixed bug where total time and memory weren't being updated properly after expressions were erased and evaluated again.

expression_benchmark.ms38.29 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture


Interesting tool.
Thanks for sharing.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.