JSMeter: Measuring JavaScript Behavior in the Wild
- Paruj Ratanaworabhan ,
- Ben Livshits ,
- David Simmons ,
- Ben Zorn
MSR-TR-2010-8 |
JavaScript is widely used in web-based applications and is increasing popular with developers. So-called browser wars in recent years have focused on JavaScript performance, specifically claiming comparative results based on benchmark suites such as SunSpider and V8. In this paper we evaluate the behavior of JavaScript web applications from commercial web sites and compare this behavior with the benchmarks.
We measure two specific areas of JavaScript runtime behavior: 1) functions and code and 2) events and handlers. We find that the benchmarks are not representative of many real web sites and that conclusions reached from measuring the benchmarks may be misleading.
Specific common behaviors of real web sites that are underemphasized in the benchmarks include event-driven execution, instruction mix similarity, cold-code dominance, and the prevalence of short functions.
We hope our results will convince the JavaScript community to develop and adopt benchmarks that are more representative of real web