-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example browser benchmark #3
Comments
I think after a few rounds of perf improvements this testing method is starting to show it's weaknesses. Particularly how often a test is repeated and how outliers are handled. Here's a test on Firefox with 22 repeats, removing the min and max value before averaging, listing them separately. (There should be no changes in the code paths for these tests between master/dev).
Note that almostHalves has 21ms difference in AVG, even though they run identical code, across the 20 results used for each value. My guess is that these large deviations have to do with the browser's scheduling and garbage collection. As the same test on Chromium looks like:
Both browsers show though, the minimums do not look like the averages, which do not look like the maximums. Significant deviation (2x-15x max vs min) is to be expected. Concluding I would say, this method can't currently show small improvements like 10-20% better than before due to it being so jittery. Specific test cases should be made to magnify performance gains so they show around 2x improvement or more for that case. Also, the results between browsers should be compared to estimate the influence of scheduling and GC. Future For the time being I think pull-block has gained a lot of speed boost and is unlikely to be the performance bottleneck for it's current use-cases. Now is probably a good time to look at other components for this type of perf attention rather than diving into the 10-20% improvements domain. So here are some options:
|
I have been using Benchmark quite successfully in other projects, and it's pretty easy to use in both browser and nodejs if you make sure to assign |
I spoke too soon about the inconsistent results in Firefox. Turns out the DOM changes I did for displaying status triggered uBlock and that ruined most of the performance. Disabling all addons and doing less DOM operations speeds up and smoothes out the results a lot. Almost on par with Chromium.
|
Published the latest version as |
It isn't the prettiest framework, but it produced some insights.
https://github.com/Beanow/pull-block-browserbench
To test the #2 theories. There's a "dev" version of pull-block there which has the implementation without any concat or slices, using only alloc and copy. PR #4
So it's a gain, but certainly not as big of a difference as the previous patch. And interestingly it seems my previous patch slightly regressed performance for the high volume scenario.
I do suppose that these tests don't cover enough cases to decide which is better. Hence I'm putting it up as a separate issue. Does this make sense as a test method and what more cases does it need?
The text was updated successfully, but these errors were encountered: