JSMeter: Characterizing Real-World Behavior of JavaScript Programs

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 websites and compare this behavior with the benchmarks. We measure three specific areas of JavaScript runtime behavior: 1) functions and code; 2) heap-allocated objects and data; 3) events and handlers. We find that the benchmarks are not representative of many real websites and that conclusions reached from measuring the benchmarks may be misleading. Specific examples of such misleading conclusions include the following: that web applications have many loops, that non-string objects in web applications are extremely short-lived, and that web applications handle few events. We hope our results will convince the JavaScript community to develop and adopt benchmarks that are more representative of real web applications. To reduce the total length of the paper, we have chosen to shrink our figures substantially, and we recommend that an interested reader view the document in color, preferably with the ability to enlarge the figures as needed. Our intent of including this much raw data is to allow interested readers an opportunity to draw their own conclusions.

[1]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[2]  Randall B. Smith,et al.  Self: The power of simplicity , 1987, OOPSLA 1987.

[3]  Dirk Grunwald,et al.  Quantifying Behavioral Differences Between C and C++ Programs , 1994 .

[4]  Alec Wolman,et al.  The structure and performance of interpreters , 1996, ASPLOS VII.

[5]  Kenneth A. Hawick,et al.  Analysis and development of Java Grande benchmarks , 1999, JAVA '99.

[6]  Tarja Systä,et al.  Understanding the Behavior of Java Programs , 2000, WCRE.

[7]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

[8]  Toshiaki Yasue,et al.  Overview of the IBM Java Just-in-Time Compiler , 2000, IBM Syst. J..

[9]  Jin-Soo Kim,et al.  Memory system behavior of Java programs: methodology and analysis , 2000, SIGMETRICS '00.

[10]  Mauricio J. Serrano,et al.  Characterizing the memory behavior of Java workloads: a structured view and opportunities for optimizations , 2001, SIGMETRICS '01.

[11]  Narayanan Vijaykrishnan,et al.  Java Runtime Systems: Characterization and Architectural Implications , 2001, IEEE Trans. Computers.

[12]  Toshiaki Yasue,et al.  An Empirical Study of Method In-lining for a Java Just-in-Time Compiler , 2002, Java Virtual Machine Research and Technology Symposium.

[13]  K. Driesen,et al.  Dynamic metrics for java , 2003, OOPSLA '03.

[14]  Emery D. Berger,et al.  Quantifying the performance of garbage collection vs. explicit memory management , 2005, OOPSLA '05.

[15]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[16]  Robert Richards,et al.  Document Object Model (DOM) , 2006 .

[17]  Kathryn S. McKinley,et al.  Generating object lifetime traces with Merlin , 2006, TOPL.

[18]  Benjamin Livshits,et al.  Doloto: code splitting for network-bound web 2.0 applications , 2008, SIGSOFT '08/FSE-16.

[19]  John Erich,et al.  Information technology 2008. , 2008, EMS magazine.

[20]  Nordin Abu Bakar,et al.  Application performance benchmark: An experimental analysis on C# programs , 2008, 2008 International Symposium on Information Technology.

[21]  Anthony T. Holdener Ajax: the definitive guide , 2008 .

[22]  Mason Chang,et al.  Trace-based just-in-time type specialization for dynamic languages , 2009, PLDI '09.

[23]  Jan Vitek,et al.  Understanding the dynamics of JavaScript , 2009 .

[24]  Benjamin Livshits,et al.  AjaxScope: A Platform for Remotely Monitoring the Client-Side Behavior of Web 2.0 Applications , 2010, ACM Trans. Web.

[25]  Benjamin Livshits,et al.  AjaxScope: a platform for remotely monitoring the client-side behavior of web 2.0 applications , 2007, TWEB.

[26]  Ian T. Jolliffe,et al.  Principal Component Analysis , 2002, International Encyclopedia of Statistical Science.