Executable Code Recompilation for Speed Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing executable code is often generic and inefficient, leading to slower execution times due to variable-based branching and unnecessary code execution, as existing compilers and linkers struggle to optimize code for specific configurations and instances.

Innovation Solution

Recompiling executable code to replace variables with constants, eliminate unreachable code, and streamline conditional branches, thereby creating customized, lightweight code that executes faster by analyzing and optimizing code at runtime or prior to execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If generic executable code with variables is used, then code reusability and flexibility are improved, but execution speed and performance deteriorate

Engineering Contradiction:
Improvecode reusabilityVSAvoidexecution speed
Core Design Contradiction:
Adaptability or versatilityVSSpeed

Solution Approach 1:

The patent applies preliminary action by performing code specialization before execution. The system analyzes generic executable code, identifies variables with known values, and replaces them with constant values in advance. This pre-processing transforms the code into a specialized version optimized for specific execution contexts, thereby improving execution speed without sacrificing the original code's reusability during development and testing phases.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If generic executable code with conditional branches is used, then code adaptability is improved, but execution time increases due to unnecessary branch evaluation

Engineering Contradiction:
Improvecode adaptabilityVSAvoidexecution time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent applies the extraction principle by removing unnecessary conditional branches from generic executable code during the specialization process. The system analyzes control flow graphs, determines which branches are always taken based on constant value substitutions, and extracts (removes) the unreachable or redundant branch instructions. This leaves only the essential execution path, eliminating time wasted on evaluating conditions that will always resolve to the same outcome.

Inventive Principle:
Principle #2Taking out (Extraction)

3Speed

If comprehensive code analysis is performed to optimize execution, then execution speed is improved, but compilation complexity increases

Engineering Contradiction:
Improveexecution speedVSAvoidcompilation complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent applies segmentation by dividing the code optimization process into distinct, manageable phases: (1) variable value analysis to identify constants, (2) control flow graph construction and analysis, (3) branch determination based on constant propagation, and (4) code generation with optimized instructions. This segmented approach breaks down the complex compilation task into smaller, more tractable sub-tasks, making the overall process more manageable while still achieving significant execution speed improvements.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8726255B2Recompiling with generic to specific replacement
Publication Date: 2014.05.13 MICROSOFT TECHNOLOGY LICENSING LLC
  • US8726255B2 patent drawing
  • US8726255B2 patent drawing
  • US8726255B2 patent drawing

AI summary

Executable code may be recompiled so that generic portions of code may be replaced with specific portions of code. The recompilation may customize executable code for a specific use or configuration, making the code lightweight and executing faster. The replacement mechanism may replace variable names with fixed values, replace conditional branches with only those branches which are known to be executed, and may eliminate executable code portions that are not executed. The replacement mechanism may comprise identifying known values defined in the executable code for variables, and replacing those variables with the constant value. Once the constants are substituted, the code may be analyzed to identify branches that may be evaluated using the constant values. Those branches may be reformed using the constant value and the rest of the conditional code that may not be accessed may be removed.