Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2786805.2786831acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

JITProf: pinpointing JIT-unfriendly JavaScript code

Published: 30 August 2015 Publication History

Abstract

Most modern JavaScript engines use just-in-time (JIT) compilation to translate parts of JavaScript code into efficient machine code at runtime. Despite the overall success of JIT compilers, programmers may still write code that uses the dynamic features of JavaScript in a way that prohibits profitable optimizations. Unfortunately, there currently is no way to measure how prevalent such JIT-unfriendly code is and to help developers detect such code locations. This paper presents JITProf, a profiling framework to dynamically identify code locations that prohibit profitable JIT optimizations. The key idea is to associate meta-information with JavaScript objects and code locations, to update this information whenever particular runtime events occur, and to use the meta-information to identify JIT-unfriendly operations. We use JITProf to analyze widely used JavaScript web applications and show that JIT-unfriendly code is prevalent in practice. Furthermore, we show how to use the approach as a profiling technique that finds optimization opportunities in a program. Applying the profiler to popular benchmark programs shows that refactoring these programs to avoid performance problems identified by JITProf leads to statistically significant performance improvements of up to 26.3% in 15 benchmarks.

References

[1]
Native vs Typed JS Array Speed (last visited: May 2015). http://jsperf.com/native-vs-typed-js-array-speed/23.
[2]
Performance Tips for JavaScript in V8 (last visited: May 2015). http://www.html5rocks.com/en/tutorials/speed/v8/.
[3]
Writing Fast, Memory-Efficient JavaScript (last visited: May 2015). http://www.smashingmagazine.com/2012/11/05/ writing-fast-memory-efficient-javascript/.
[4]
W. Ahn, J. Choi, T. Shull, M. J. Garzaran, and J. Torrellas. Improving JavaScript performance by deconstructing the type system. In PLDI, 2014.
[5]
R. Bell, A. D. Malony, and S. Shende. Paraprof: A portable, extensible, and scalable tool for parallel performance profile analysis. In Euro-Par, pages 17–26, 2003.
[6]
E. Berg and E. Hagersten. Fast data-locality profiling of native execution. In SIGMETRICS, pages 169–180. ACM, 2005.
[7]
C. Chambers, D. Ungar, and E. Lee. An efficient implementation of self - a dynamically-typed object-oriented language based on prototypes. In OOPSLA, pages 49–70, 1989.
[8]
I. Costa, P. Alves, H. N. Santos, and F. M. Q. Pereira. Just-in-time value specialization. In CGO, pages 1–11, 2013.
[9]
C. Curtsinger and E. D. Berger. STABILIZER: statistically sound performance evaluation. In ASPLOS, pages 219–228. ACM, 2013.
[10]
M. Diep, M. B. Cohen, and S. G. Elbaum. Probe distribution techniques to profile events in deployed software. In 17th International Symposium on Software Reliability Engineering (ISSRE 2006), 7-10 November 2006, Raleigh, North Carolina, USA, pages 331–342. IEEE Computer Society, 2006.
[11]
Y. Ding, M. Zhou, Z. Zhao, S. Eisenstat, and X. Shen. Finding the limit: examining the potential and complexity of compilation scheduling for jit-based runtime systems. In ASPLOS, pages 607–622, 2014.
[12]
J. Flinn and M. Satyanarayanan. Powerscope: A tool for profiling the energy usage of mobile applications. In WMCSA, pages 2–10. IEEE Computer Society, 1999.
[13]
A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In PLDI, pages 465–478, 2009.
[14]
A. Georges, D. Buytaert, and L. Eeckhout. Statistically rigorous Java performance evaluation. In OOPSLA, pages 57–76. ACM, 2007.
[15]
L. Gong, M. Pradel, and K. Sen. JITProf: Pinpointing JIT-unfriendly JavaScript code. Technical Report UCB/EECS-2014-144, EECS Department, University of California, Berkeley, Aug 2014.
[16]
L. Gong, M. Pradel, M. Sridharan, and K. Sen. DLint: Dynamically checking bad coding practices in JavaScript. In ISSTA, 2015.
[17]
S. L. Graham, P. B. Kessler, and M. K. Mckusick. Gprof: A call graph execution profiler. In SIGPLAN Symposium on Compiler Construction, pages 120–126. ACM, 1982.
[18]
B. Hackett and S.-y. Guo. Fast and precise hybrid type inference for JavaScript. In Conference on Programming Language Design and Implementation (PLDI), pages 239–250. ACM, 2012.
[19]
B. Hackett and S. yu Guo. Fast and precise hybrid type inference for javascript. In PLDI, pages 239–250. ACM, 2012.
[20]
C. Hammacher, K. Streit, S. Hack, and A. Zeller. Profiling java programs for parallelism. In Proceedings of the 2009 ICSE Workshop on Multicore Software Engineering, IWMSE ’09, pages 49–55, Washington, DC, USA, 2009. IEEE Computer Society.
[21]
S. Han, Y. Dang, S. Ge, D. Zhang, and T. Xie. Performance debugging in the large via mining millions of stack traces. In International Conference on Software Engineering (ICSE), pages 145–155. IEEE, 2012.
[22]
M. Hauswirth, P. F. Sweeney, A. Diwan, and M. Hind. Vertical profiling: understanding the behavior of object-oriented applications. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 251–269, 2004.
[23]
G. Jin, L. Song, X. Shi, J. Scherpelz, and S. Lu. Understanding and detecting real-world performance bugs. In Conference on Programming Language Design and Implementation (PLDI), pages 77–88. ACM, 2012.
[24]
M. Jovic, A. Adamoli, and M. Hauswirth. Catch me if you can: performance bug detection in the wild. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 155–170. ACM, 2011.
[25]
E. Lavoie, B. Dufour, and M. Feeley. Portable and efficient run-time monitoring of javascript applications using virtual machine layering. In ECOOP, pages 541–566, 2014.
[26]
A. R. Lebeck and D. A. Wood. Cache profiling and the spec benchmarks: A case study. IEEE Computer, 27(10):15–26, 1994.
[27]
B. Liblit, A. Aiken, A. X. Zheng, and M. I. Jordan. Bug isolation via remote program sampling. In R. Cytron and R. Gupta, editors, Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation 2003, San Diego, California, USA, June 9-11, 2003, pages 141–154. ACM, 2003.
[28]
D. Marinov and R. O’Callahan. Object equality profiling. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 313–325, 2003.
[29]
R. B. Miller. Response time in man-computer conversational transactions. In American Federation of Information Processing Societies: Proceedings of the AFIPS ’68 Fall Joint Computer Conference, December 9-11, 1968, San Francisco, California, USA - Part I, volume 33 of AFIPS Conference Proceedings, pages 267–277. AFIPS / ACM / Thomson Book Company, Washington D.C., 1968.
[30]
T. Mytkowicz, A. Diwan, M. Hauswirth, and P. F. Sweeney. Producing wrong data without doing anything obviously wrong! In ASPLOS, pages 265–276, 2009.
[31]
J. Nielsen. Usability Engineering. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1993.
[32]
A. Nistor, L. Song, D. Marinov, and S. Lu. Toddler: Detecting performance problems via similar memory-access patterns. In International Conference on Software Engineering (ICSE), pages 562–571, 2013.
[33]
A. Nistor, L. Song, D. Marinov, and S. Lu. Toddler: detecting performance problems via similar memory-access patterns. In ICSE, pages 562–571. IEEE / ACM, 2013.
[34]
M. Pradel, P. Schuh, G. Necula, and K. Sen. EventBreak: Analyzing the responsiveness of user interfaces through performance-guided test generation. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2014.
[35]
M. Pradel, P. Schuh, and K. Sen. TypeDevil: Dynamic type inconsistency analysis for JavaScript. In International Conference on Software Engineering (ICSE), 2015.
[36]
M. Pradel and K. Sen. The good, the bad, and the ugly: An empirical study of implicit type conversions in javascript. In ECOOP, 2015.
[37]
L. Ravindranath, J. Padhye, S. Agarwal, R. Mahajan, I. Obermiller, and S. Shayandeh. AppInsight: mobile app performance monitoring in the wild. In Conference on Operating Systems Design and Implementation (OSDI), pages 107–120. USENIX, 2012.
[38]
G. Richards, A. Gal, B. Eich, and J. Vitek. Automated construction of JavaScript benchmarks. In OOPSLA, pages 677–694, 2011.
[39]
G. Richards, S. Lebresne, B. Burg, and J. Vitek. An analysis of the dynamic behavior of javascript programs. In PLDI, pages 1–12. ACM, 2010.
[40]
K. Sen, S. Kalasapur, T. Brutch, and S. Gibbs. Jalangi: A selective record-replay and dynamic analysis framework for JavaScript. In European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE), 2013.
[41]
A. Shankar, M. Arnold, and R. Bod´ık. Jolt: lightweight dynamic analysis and removal of object churn. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 127–142. ACM, 2008.
[42]
S. Shende and A. D. Malony. The tau parallel performance system. International Journal of High Performance Computing Applications, pages 287–311, 2006.
[43]
L. Song and S. Lu. Statistical debugging for real-world performance problems. In Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA), pages 561––578. ACM, 2014.
[44]
V. St-Amour and S. Guo. Optimization coaching for javascript. In ECOOP, 2015.
[45]
V. St-Amour, S. Tobin-Hochstadt, and M. Felleisen. Optimization coaching: optimizers learn to communicate with programmers. In OOPSLA, pages 163–178, 2012.
[46]
X. Xiao, J. Zhou, and C. Zhang. Tracking data structures for postmortem analysis. In ICSE, pages 896–899. ACM, 2011.
[47]
G. Xu. Finding reusable data structures. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 1017–1034. ACM, 2012.
[48]
G. Xu and A. Rountev. Detecting inefficiently-used containers to avoid bloat. In Conference on Programming Language Design and Implementation (PLDI), pages 160–173. ACM, 2010.
[49]
G. H. Xu, M. Arnold, N. Mitchell, A. Rountev, and G. Sevitsky. Go with the flow: profiling copies to find runtime bloat. In Conference on Programming Language Design and Implementation (PLDI), pages 419–430. ACM, 2009.
[50]
G. H. Xu, N. Mitchell, M. Arnold, A. Rountev, E. Schonberg, and G. Sevitsky. Finding low-utility data structures. In Conference on Programming Language Design and Implementation (PLDI), pages 174–186, 2010.
[51]
H. Xu, C. J. F. Pickett, and C. Verbrugge. Dynamic purity analysis for Java programs. In Workshop on Program Analysis for Software Tools and Engineering (PASTE), pages 75–82. ACM, 2007.
[52]
D. Yan, G. H. Xu, and A. Rountev. Uncovering performance problems in Java applications with reference propagation profiling. In International Conference on Software Engineering, (ICSE), pages 134–144. IEEE, 2012.
[53]
X. Yu, S. Han, D. Zhang, and T. Xie. Comprehending performance from real-world execution traces: a device-driver case. In ASPLOS, pages 193–206, 2014.
[54]
N. C. Zakas. High performance javascript - build faster web application interfaces. 2010.
[55]
X. Zhuang, S. Kim, M. J. Serrano, and J.-D. Choi. Perfdiff: a framework for performance difference analysis in a virtual machine environment. In Symposium on Code Generation and Optimization (CGO), pages 4–13. ACM, 2008.

Cited By

View all
  • (2024)BoaSpect: An Expressive Instrumentation Platform for JavaScriptCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660839(47-51)Online publication date: 11-Mar-2024
  • (2024)FlowProf: Profiling Multi-threaded Programs using Information-FlowProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641577(137-149)Online publication date: 17-Feb-2024
  • (2024)Os noise mitigations for benchmarking web browser execution environment performanceDiscover Computing10.1007/s10791-024-09471-427:1Online publication date: 29-Oct-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ESEC/FSE 2015: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering
August 2015
1068 pages
ISBN:9781450336758
DOI:10.1145/2786805
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 August 2015

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. JITProf
  2. Jalangi
  3. JavaScript
  4. dynamic analysis
  5. just-in-time compilation
  6. profiler

Qualifiers

  • Research-article

Funding Sources

Conference

ESEC/FSE'15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 112 of 543 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)45
  • Downloads (Last 6 weeks)3
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)BoaSpect: An Expressive Instrumentation Platform for JavaScriptCompanion Proceedings of the 8th International Conference on the Art, Science, and Engineering of Programming10.1145/3660829.3660839(47-51)Online publication date: 11-Mar-2024
  • (2024)FlowProf: Profiling Multi-threaded Programs using Information-FlowProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641577(137-149)Online publication date: 17-Feb-2024
  • (2024)Os noise mitigations for benchmarking web browser execution environment performanceDiscover Computing10.1007/s10791-024-09471-427:1Online publication date: 29-Oct-2024
  • (2023)User-Customizable Transpilation of Scripting LanguagesProceedings of the ACM on Programming Languages10.1145/35860347:OOPSLA1(201-229)Online publication date: 6-Apr-2023
  • (2022)DynaPyt: a dynamic analysis framework for PythonProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3549126(760-771)Online publication date: 7-Nov-2022
  • (2022)Performance Analysis and Comparison of Acceleration Methods in JavaScript Environments Based on Simplified Standard Hough Transform AlgorithmNew Advances in Dependability of Networks and Systems10.1007/978-3-031-06746-4_13(131-142)Online publication date: 27-May-2022
  • (2021)Automatically Assessing and Extending Code Coverage for NPM Packages2021 IEEE/ACM International Conference on Automation of Software Test (AST)10.1109/AST52587.2021.00013(40-49)Online publication date: May-2021
  • (2021)Computation at the Edge with WebAssemblyITNG 2021 18th International Conference on Information Technology-New Generations10.1007/978-3-030-70416-2_30(229-238)Online publication date: 5-Jun-2021
  • (2020)Orchestrating dynamic analyses of distributed processes for full-stack JavaScript programsACM SIGPLAN Notices10.1145/3393934.327813553:9(107-118)Online publication date: 7-Apr-2020
  • (2020)Enhancing Web App Execution with Automated ReengineeringCompanion Proceedings of the Web Conference 202010.1145/3366424.3382087(274-278)Online publication date: 20-Apr-2020
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media