When comparing benchmark.js vs jsPerf, the Slant community recommends jsPerf for most people. In the question“What are the best javascript benchmarking libraries?” jsPerf is ranked 1st while benchmark.js is ranked 2nd. The most important reason people chose jsPerf is:
jsPerf is focused on being able to share your tests, so it can auto-generate a shareable link for your test.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Automatically determines the best timer
Benchmark.js has a number of timers available for different platforms and will chose whichever one is the highest resolution for your specific platform. This lets you know you're getting the most precise measurements, regardless of what you're developing on.
Pro Simple syntax
Benchmark.js takes most of the fiddling out of typical benchmarking. As an example, most benchmarkers will need you to specify the number of times you want a function tested, but benchmark.js handles the iterations for you. All you need to do is write the test.
Pro Supports shareable test URLs
jsPerf is focused on being able to share your tests, so it can auto-generate a shareable link for your test.
Pro Developer is open and active within the community
This is always nice, and the dev says he's "open to suggestions" as far as new features go.
Pro You can use Chrome/Chromium's built in benchmarkers with it
By setting the --enable-benchmarking flag, you can improve the accuracy of jsPerfs benchmarking through these browsers by using the built-in benchmarking extensions.
Pro Based on Benchmark.js, so you have the same timers
jsPerf is based on Benchmark.js, so you'll get the same benefits of Benchmark's high resolution and dynamic timers with a different codebase.
Cons
Con Simple syntax can mean less control
Benchmark.js calls really simply, which is great, but it can lead to having less control over a specific test.
Con Can take some fiddling to get to work with ie9 and below
If you happen to be testing with one of Microsoft's older browsers, then you'll need to play around with the Java plugins a bit to get it to run.
