Selective Function Unoptimization for Debugging Optimized Code

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Debugging optimized code is challenging due to issues like the 'hopping Program Counter' problem, 'cross-jumping,' and 'roving variables' caused by optimizations, which invalidate debugging data and make it difficult for developers to inspect variables and follow code execution.

Innovation Solution

A software development system that allows users to selectively unoptimize or re-optimize functions within the source code during debugging, enabling an edit and continue operation to generate a compiled version with specific functions unoptimized or re-optimized, while others remain optimized, using features like #pragma optimize directives and incremental compilation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If code optimization is applied to improve execution speed and resource efficiency, then program performance is improved, but debugging difficulty increases due to hopping program counter, cross-jumping, and roving variable phenomena

Engineering Contradiction:
Improveprogram execution speedVSAvoiddebugging ease
Core Design Contradiction:
SpeedVSEase of operation

Solution Approach 1:

The patent segments the code into optimized and unoptimized portions, allowing different compilation modes for different functions. The system divides the program into modules where critical performance functions remain optimized while debugging-related functions are unoptimized, enabling simultaneous achievement of execution speed and debugging ease through selective compilation strategies.

Inventive Principle:
Principle #1Segmentation

2Use of energy by moving object

If full optimization is applied to the entire program, then resource efficiency is improved, but code modifiability during debugging deteriorates

Engineering Contradiction:
Improveresource efficiencyVSAvoidcode modifiability
Core Design Contradiction:
Use of energy by moving objectVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic optimization control where the optimization state of code segments can change during the development process. The system allows developers to dynamically adjust which functions are optimized versus unoptimized based on debugging needs, enabling the program to adapt its optimization level without requiring full recompilation, thus maintaining both resource efficiency and code modifiability.

Inventive Principle:
Principle #15Dynamics

3Ease of operation

If selective unoptimization of individual functions is enabled during debugging, then debugging ease is improved, but compilation complexity increases

Engineering Contradiction:
Improvedebugging easeVSAvoidcompilation complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent implements self-service mechanisms where the compilation system automatically manages the complexity of selective optimization. The compiler automatically identifies which functions should be optimized versus unoptimized based on developer preferences or analysis, and handles the recompilation process automatically, freeing developers from manually managing compilation complexity while still enabling selective unoptimization for debugging purposes.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS10540262B2Using edit and continue to dynamically set and unset optimizations in source code while debugging
Publication Date: 2020.01.21 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10540262B2 patent drawing
  • US10540262B2 patent drawing
  • US10540262B2 patent drawing

AI summary

A software development system is described that enables a user that is debugging source code to select for unoptimizing a function within the source code and to cause an edit and continue operation to be performed that produces a compiled version of the source code in which the selected function is unoptimized, while other functions remain optimized. Embodiments also enable a user to select a previously unoptimized function within the source code for re-optimizing and to cause an edit and continue operation to be performed that produces a compiled version of the source code in which the function is re-optimized. Still further embodiments enable a user to select within source code that is being developed a function for which optimization should be prevented and to cause a compiled representation of the source code to be built in which the selected function is unoptimized, while other functions are optimized.