开发者

High speed Javascript benchmarking

Does anyone know of a fast way to benchmark a user's browser? It doesn't need to be all that accurate.

I am starting to peform more and more intensive tasks with Javascript in our software platform and I am concerned that performance is going to be an issue on older browsers so what I want is something that I can run very quickly to give me a rough idea of what the client machine is capable of.

For users with a low score I could turn off effects开发者_StackOverflow社区 and animations and things like that.

I also want to start using a couple of IE specific CSS tools like PIE and Selectivizr, but I'm concerned about slowing down machines for the sake of rounded corners and border radiuses.

Anyone have any ideas?


Not sure if it will help you, but have a look at Benchmark.js, the library that is used by http://jsperf.com/.


I've been using JSLitmus for my benchmarking needs, and it is designed for quick result. You give it your functions, start test, and it would spend one to two seconds on each functions.

It would run a given function in a loop, and adjusting the loop count each time depending on the time it took last lap to get a relatively accurate call speed per second in a short time. For example if you test a function 1000 times and find that it finish within 10ms, you know you can increase it to at least 10000 time and still spend less then 100ms. If the result is, say, still less then 10ms then you know you can times 10 again, or if the time is big enough then you can try numbers around the range to get more precise result.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜