Precompiled JavaScript Storage for Browser Page Load Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current JavaScript engines in browsers spend a significant portion of page load time compiling and executing JavaScript code, which slows down the loading of webpages, with 30% of page load time attributed to JavaScript evaluation.
Innovation Solution
Implementing a preemptive compilation method where scripting-language code, such as JavaScript, is precompiled and stored on a communication device before it is requested, allowing for immediate execution when the webpage is accessed, thereby avoiding the need for recompilation and reducing page load times.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If JavaScript code is compiled at runtime during page loading, then the browser can execute the code immediately, but the page load time increases significantly due to compilation overhead
Solution Approach 1:
The patent applies preliminary action by precompiling JavaScript code before the page is actually loaded. The system identifies JavaScript files that need to be compiled, performs the compilation in advance during a separate compilation phase, and stores the compiled code so it can be executed immediately when the page loads, thereby eliminating the compilation delay during page load time
Solution Approach 2:
The patent segments the JavaScript compilation process into a separate precompilation phase and an execution phase. Instead of compiling code inline during page loading, the system separates these operations: first identifying and precompiling the JavaScript code, then executing it when needed. This segmentation allows the compilation overhead to be performed independently of the page load time
2Quantity of substance
If compiled code is removed from memory to free space, then memory efficiency improves, but the precompiled code becomes unavailable for immediate execution
Solution Approach 1:
The patent applies local quality by creating a special protected storage region for precompiled JavaScript code within the memory system. This protected area distinguishes precompiled code from other temporary code, ensuring that precompiled code is retained in memory even when other code is cleaned up or when memory pressure exists. The protected storage location ensures immediate code availability without interfering with general memory management
Data Source
AI summary
Methods and apparatus for processing scripting-language code in webpages are disclosed. The method includes obtaining scripting-language code that is utilized by a higher-priority webpage, compiling the scripting-language code to generate higher-priority compiled code objects, storing the higher-priority compiled code objects on a communication device, distinguishing the higher-priority compiled code objects from other compiled code objects that are stored on the communication device to delay the higher-priority compiled code objects from being removed from the communication device, and executing the higher-priority compiled code objects when the webpage is requested by the user. In many variations, this approach is not applied to all webpages visited, but only on certain webpages and scripts that are considered high priority, either implicitly or explicitly, based on a priority function that computes a multi-level priority from the history and past browser activity.


