regexr icon indicating copy to clipboard operation
regexr copied to clipboard

Expression performance benchmark feature

Open Niels-NTG opened this issue 6 years ago • 3 comments

Currently you can see the amount of matches for the current expresion and a rough figure on how long it took to get this result in milliseconds. It seems that this number only represents one measurement for the current combination of expression and text. This is perfectly fine, but it doesn't give a reliable figure. When you change something in the current expression or text and then undo this change, the amount of milliseconds displayed is not always the same as before.

What I like to suggest is a new tab in the Tools panel to measure the performance of the current combination of expression and text. This executes the expression 100 times and than shows the users some stats on it's performance for the current text. Statistics like:

  • Operations per second
  • Average time of a single operation
  • Median time of a single operation
  • Shortest operation time
  • Longest operation time
  • Current browser/user agent (Because it's important to emphasise that these numbers are not necessarily representative of other browsers/computers)

Niels-NTG avatar Dec 21 '17 12:12 Niels-NTG

This would be totally doable for the JS flavor, but poses problems for flavors that are run on the server. We can't afford the processing to have people running hundreds or thousands of executions on the server. Thoughts on limiting this to JS? The tool would wind up just showing a message that it's unavailable for other flavors.

gskinner avatar Jun 08 '18 17:06 gskinner

To be honest I didn't even consider the server flavour when writing my proposal. Limiting this feature to JS would be fine by me.

Niels-NTG avatar Jun 11 '18 08:06 Niels-NTG

You could only enable server side for self hosted version or create a paid hosted version with credits people can consume for heavy operations.

windware-ono avatar Mar 19 '22 09:03 windware-ono