Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

JavaScript code optimization method based on front-end byte code technology

A code optimization and bytecode technology, applied in code compilation, program code conversion, electrical digital data processing, etc., can solve problems such as performance loss, application range and versatility limitations, data type derivation errors, etc., to reduce the number of calls , the effect of reducing the number of data transfers

Active Publication Date: 2019-11-01
NORTHWEST UNIV(CN)
View PDF5 Cites 12 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

At present, the optimization of JavaScript is mainly from compiler-level just-in-time compilation, low-level code compilation and partial solution. The optimization scheme of just-in-time compilation has greatly improved the execution of JavaScript, but the wrong data type derivation will lead to de-optimization The performance loss of the process and the running of the monitor during execution will cause performance loss. Low-level code compilation and partial solving have limitations in application range and generality. These optimization solutions cannot solve the problem of a large number of computationally intensive codes performance problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • JavaScript code optimization method based on front-end byte code technology
  • JavaScript code optimization method based on front-end byte code technology
  • JavaScript code optimization method based on front-end byte code technology

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] The present invention proposes a JavaScript code optimization method based on front-end bytecode technology through research on JavaScript code performance optimization technology to improve program execution efficiency, which specifically includes the following steps:

[0036] Step 1. Execute the JavaScript code to be optimized. During the execution process, obtain the data type information and data value in the path to be executed, as well as the code segment with stable data type; the code segment with stable data type refers to the A code segment with stable variable data types in the path.

[0037] In this step, use the existing mature technology dynamic symbolic execution framework to run the JavaScript code to be optimized, obtain the variable name, variable data value, data type, node type on each execution path during the execution process, and use the tree data The structure holds this information, such as figure 2 As shown, we call it VariableTree. Each ex...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a JavaScript code optimization method based on a front-end byte code technology. According to the method, a conversion tool chain from JavaScript to WebAssembly is provided, acode segment merging strategy is designed, and then a JavaScript performance optimization scheme is provided; and variable type information of each execution path of the program is obtained through dynamic symbolic execution, and a code statement according with a conversion condition is obtained through a screening rule, a C code is generated from a JavaScript code by designing a JavaScript 2C conversion rule, and a WebAssembly code segment is generated through Exscript compiling. And finally, the performance and function consistency before and after optimization are compared through a unit test idea, and the optimization of the code segment is given up if the performance is reduced or the functions are inconsistent. On the other hand, a code segment merging strategy is designed, on the basis of the data dependence relation between the code segments, the code segment merging strategy is provided as the basis of user code reconstruction, the purpose of reducing data interaction performance losses is achieved, and the execution efficiency of the program is further improved.

Description

technical field [0001] The invention relates to the technical field of data computer code optimization, and in particular relates to a JavaScript code optimization method based on front-end bytecode technology. Background technique [0002] JavaScript was originally designed as a small scripting language to realize HTML DOM interaction. One of its typical applications is to verify user form input and so on. However, with the development of the Internet, the functions of Web applications are becoming more and more abundant, and the application platforms are also gradually diversified. Due to JavaScript's absolute monopoly in Web application development, it has to serve applications based on computationally intensive operations, such as image processing, virtual reality, and game engines. Although JavaScript has continued to develop over the years, it is still difficult to cope with the huge amount of calculations, especially on platforms with limited computing resources. ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41G06F8/40
CPCG06F8/40G06F8/443
Inventor 王薇汤战勇王帅薛超房鼎益陈晓江
Owner NORTHWEST UNIV(CN)
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products