JSOptimizer: An Extensible Framework for JavaScript Program Optimization
Yi Liu · 2019
JavaScript has become a popular programming language. It is widely used in both client-side and server-side programming in web applications. The robustness and performance of JavaScript programs become vital. Unfortunately, real-world JavaScript programs often suffer from various issues. In this work, we present nine issue patterns derived from open-source projects and propose a general static analysis framework, JSOptimizer, to help detect such patterns of issues and optimize the code accordingly. Comparing to existing work, JSOptimizer is not only highly extensible but also performs code optimizations automatically. We applied JSOptimizer to seven real open-source JavaScript projects and five bugs detected by it have been confirmed by developers. Besides, we conducted a case study based on a popular project and found that addressing the issues detected by our framework can speed up the original project by over 300%. This shows the usefulness of JSOptimizer.