Javascript Code Simplification And Optimization Based On Hybrid Static and Dynamic Analysis Techniques
With the increasing complexity of Web application functions, JavaScript libraries are widely used to improve development efficiency and user experience. However, many applications do not make full use of all JavaScript code during loading, resulting in redundant code being packaged into deployment files, which increases the page loading burden and affects performance. Existing optimization methods often rely on static analysis or dynamic analysis, but these methods alone are difficult to fully identify redundant code, static analysis cannot capture the dynamic behavior of the run time, and dynamic analysis is limited by test coverage and prone to false positives. Therefore, a hybrid analysis method combining static analysis and dynamic monitoring is proposed in this paper. Through static analysis, function call diagram is constructed and redundant functions are identified. Meanwhile, dynamic piling technology is combined to track code execution and supplement the shortcomings of static analysis, and accurate function call diagram is generated to identify and optimize redundant code. Based on this method, this paper develops a JavaScript code optimization tool that can automatically identify redundant code and reduce the size of the deployment package. Experimental results show that this tool can reduce about 59% of redundant code and improve the loading performance and stability of Web applications.
Authors
- Yuantong Gu (ORCID: https://orcid.org/0000-0002-2770-5014)
Publication Details
- Published
- 2025-03-07
- DOI
- https://doi.org/10.1109/csnt64827.2025.10968913
- Primary Topic
- Software Reliability and Analysis Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00