Context-Sensitive Optimization Level Selection for Web Code

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing web browser optimization techniques, such as Just-In-Time compilation and profile-based optimization, often result in delayed performance improvements and inefficient resource allocation, as they rely on code invocation and execution profiling, which can lead to suboptimal optimization decisions and increased overhead.

Innovation Solution

A context-sensitive optimization method that selects the level of performance optimization for web page code segments based on the origin of the webpage, using information such as domain name, usage behavior, and aggregated user data to predict and apply the most suitable optimization level immediately upon webpage download, independent of exact code patterns or execution profiles.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If Just-In-Time compilation and profile-based optimization are used, then runtime performance is improved, but optimization decisions are delayed and resource allocation is inefficient

Engineering Contradiction:
Improveruntime performanceVSAvoidoptimization decision delay
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by making optimization decisions before code execution begins. Instead of waiting for code to be invoked and profiled, the system uses heuristics based on code characteristics, origin, and context to select optimization levels in advance. This eliminates the delay inherent in profile-based approaches while maintaining effective optimization.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent changes the parameter for optimization decision-making from execution-based metrics (call counts, execution time) to pre-execution characteristics (code size, structure, origin, context). This parameter transformation enables timely decisions without requiring code to run first, resolving the contradiction between performance improvement and decision timing.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If profile-based optimization is used, then optimization accuracy is improved, but overhead and resource consumption increase

Engineering Contradiction:
Improveoptimization accuracyVSAvoidoptimization overhead
Core Design Contradiction:
Measurement precisionVSLoss of energy

Solution Approach 1:

The patent uses lightweight, disposable heuristics instead of expensive, persistent profiling mechanisms. Rather than maintaining complex execution profiles that consume significant resources, the system employs simple, stateless decision rules based on code characteristics and context. These cheap heuristics provide sufficient accuracy without the heavy overhead of full profiling.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

Solution Approach 2:

The patent applies partial optimization by selecting optimization levels that are sufficient rather than exhaustive. Instead of always performing the most aggressive optimization, the system chooses appropriate optimization intensity based on code characteristics and context, avoiding unnecessary overhead while achieving adequate optimization accuracy for each specific case.

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If code is optimized based on execution profiles, then optimization relevance is improved, but startup time increases

Engineering Contradiction:
Improveoptimization relevanceVSAvoidstartup time
Core Design Contradiction:
ReliabilityVSDuration of action of moving object

Solution Approach 1:

The patent makes optimization decisions in advance before code execution starts. By using heuristics that evaluate code characteristics and context upfront, the system determines optimization levels immediately upon code loading, eliminating the startup delay caused by waiting for execution profiles to accumulate during runtime.

Inventive Principle:
Principle #10Preliminary action

4Reliability

If aggressive optimization is applied to all code, then performance improvement is maximized, but resource allocation efficiency decreases

Engineering Contradiction:
Improveperformance improvementVSAvoidresource allocation efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies local quality by tailoring optimization intensity to specific code segments based on their characteristics and context. Rather than uniformly applying aggressive optimization to all code, the system selectively applies appropriate optimization levels to different code regions, functions, or modules, maximizing performance improvement where needed while conserving resources where minimal optimization is sufficient.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent makes optimization strategies dynamic by adjusting optimization levels based on runtime context, code characteristics, and measured performance. The system continuously adapts its optimization approach rather than using a fixed aggressive strategy, allocating resources efficiently by intensifying optimization only when context indicates it will yield beneficial results.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS9134978B1Context-sensitive optimization level selection
Publication Date: 2015.09.15 GOOGLE LLC
  • US9134978B1 patent drawing
  • US9134978B1 patent drawing
  • US9134978B1 patent drawing

AI summary

A method for selecting a performance optimization level for program code segments (e.g., JavaScript code) embedded in interactive webpages according to the origin (e.g., domain) of the webpages is disclosed. The information on historic usage behavior on webpages from the same origin is collected. The historic usage behavior can be specific to the current user or an average or aggregated behavior across many users who have visited webpages from the same origin. The historic usage information is used to select an appropriate level of optimization to achieve the maximum performance improvement for the least amount of compilation cost. The selected optimization level can be adjusted over time based on a measure of actual performance improvement resulted from the different levels of optimization that had been carried out during prior visits.