mathiasbynens / jsperf.com

jsPerf.com source code
http://jsperf.com/
Other
473 stars 56 forks source link

How browserscope deals with run-time params attached to URL ? #144

Closed runsun closed 11 years ago

runsun commented 11 years ago

As shown in In an earlier question (see "Setting running variables in the URL ?" https://github.com/mathiasbynens/jsperf.com/issues/138 ), we can provide run-time variables in the url like url...#size=10. This allows users to do a lot of interesting tests -- for example, comparing different array operations at different array sizes.

What suddenly came to my mind is how the browserscope deals with it. According to the FAQ, it uses test-id to store the result. Problem is, tests with different run-time variables share the same test-id, meaning that tests with #size=10 will be stored into the same database with those with #size=100, #size=1000, etc and all will be treated like same set of tests. This would become one of possible sources for inconsistent results, if any.

Is this the case ? If yes, anyway to avoid that ? For example,

jdalton commented 11 years ago

You can dynamically change the name of each benchmark in the ui.benchmarks collection ui.benchmarks[0].name = ....

runsun commented 11 years ago

Thx for the reply. Does changing the ui.benchmarks[0].name of individual test case change the test-id of that entire jsperf as well ?

If yes, I got what I want.

jdalton commented 11 years ago

It changes the name of the test sent to browserscope so it should include it in the results.

runsun commented 11 years ago

That'll do it. Thx.