Inlining Constants to Reduce Executable Bundle Size

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional systems are inefficient in reducing the size of bundles of executable files due to the inability to effectively remove constant files, which slow down computer performance during user onboarding and other processes.

Innovation Solution

The method involves transforming constant files into inlined values, allowing large portions of computer modules to be avoided, and replacing references to pure files with their exported values, thereby unlinking and removing unnecessary files from the bundle.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of substance

If Tree Shaking technique is used to remove dead-code, then code size is reduced, but it cannot remove constant files exported as large objects

Engineering Contradiction:
Improvecode sizeVSAvoideffectiveness of dead-code removal
Core Design Contradiction:
Loss of substanceVSAdaptability or versatility

Solution Approach 1:

The patent segments the constant object into individual constant values and inlines them directly into the importing module. Instead of exporting a large constant object that must be loaded as a whole, each constant value is extracted and embedded directly where needed, allowing the constant file to be completely removed while preserving all functionality.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts individual constant values from the constant object and removes the entire constant file after inlining. The build tool traverses the dependency graph, identifies constants used by other modules, extracts their values, and replaces imports with direct value assignments, thereby taking out and eliminating the unnecessary constant file.

Inventive Principle:
Principle #2Taking out (Extraction)

2Reliability

If constant files are included in the bundle, then completeness of executable files is maintained, but processing efficiency decreases

Engineering Contradiction:
Improvecompleteness of executable filesVSAvoidprocessing efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent performs constant inlining as a preliminary action during the build process, before the executable bundle is created. By traversing the dependency graph and inlining constants upfront, the system ensures all necessary values are embedded in the remaining files, making the constant file unnecessary for execution while maintaining completeness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent copies constant values from the constant file and embeds them directly into the importing modules. Instead of referencing the constant file during execution, each module receives the actual constant values as direct assignments, eliminating the need to load and process the separate constant file while preserving all data.

Inventive Principle:
Principle #26Copying

3Quantity of substance

If large constant files are executed, then all necessary data is available, but download and execution time increases

Engineering Contradiction:
Improveavailability of dataVSAvoiddownload and execution time
Core Design Contradiction:
Quantity of substanceVSLoss of time

Solution Approach 1:

The patent applies local quality by inlining constant values directly into the specific modules that need them. Each module receives only the constant values it requires, embedded locally within its own code, rather than loading a large centralized constant file. This reduces overall bundle size and eliminates unnecessary data transfer and processing for modules that don't use those constants.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS11893381B1Digital processing systems and methods for reducing file bundle sizes
Publication Date: 2024.02.06 MONDAY COM LTD
  • US11893381B1 patent drawing
  • US11893381B1 patent drawing
  • US11893381B1 patent drawing

AI summary

Systems, methods, and computer-readable media for constant file replacement operations in a bundle of executable files are disclosed. Systems and methods may involve receiving a plurality of files, reading contents of an impure file in the plurality of files, identifying a link between the impure file and at least one pure file in the plurality of files, and reading contents of the at least one pure file to determine exported values. The at least one pure file may lack side effects. The impure file may be traversed to determine at least one reference to the at least one pure file and ascertaining at least one exported value referenced by the at least one pure file. Systems and methods may involve replacing the at least one reference in the impure file with the ascertained at least one exported value and unlinking the at least one pure file from the impure file.