Modifying code to reduce redundant or unnecessary power usage
First Claim
1. A computer-implemented method for reducing power usage of a device, comprising:
- inputting, by computing hardware, original source code for an application;
analyzing a situation where batching is possible by identifying, from one or more instruction sequences of the original source code, library function calls that corresponds to radio requests;
estimating a power gain from batching together two or more portions of the original source code library function calls that request operation of one or more power-consuming hardware components, wherein the estimating comprises computing a minimum or average time period between execution of the two or more of the portions of the original source code library function calls, analyzing power state transitions of the radio request, and comparing the cost of the power state transitions with savings due to idle inactivity time of the power-consuming hardware components; and
modifying, by the computing hardware, the original source code so that the two or more portions of the original source code are batched together removing instances of redundant power cycling, thereby creating modified source code from which the one or more power-consuming hardware components are operated in a more power efficient manner.
3 Assignments
0 Petitions
Accused Products
Abstract
Disclosed herein are representative embodiments of methods, apparatus, and systems for analyzing and/or transforming code (typically, source code) to reduce or avoid redundant or unnecessary power usage (e.g., power cycling, resource leak bugs, and/or unnecessarily repeated activity) in the device that will ultimately execute the application defined by the source code. The disclosed methods can be implemented by a software tool (e.g., a static program analysis tool or EDA analysis tool) that analyzes and/or transforms source code for a software application to help improve the performance of the software application on the target device. The disclosed methods, apparatus, and systems should not be construed as limiting in any way.
107 Citations
25 Claims
-
1. A computer-implemented method for reducing power usage of a device, comprising:
-
inputting, by computing hardware, original source code for an application; analyzing a situation where batching is possible by identifying, from one or more instruction sequences of the original source code, library function calls that corresponds to radio requests; estimating a power gain from batching together two or more portions of the original source code library function calls that request operation of one or more power-consuming hardware components, wherein the estimating comprises computing a minimum or average time period between execution of the two or more of the portions of the original source code library function calls, analyzing power state transitions of the radio request, and comparing the cost of the power state transitions with savings due to idle inactivity time of the power-consuming hardware components; and modifying, by the computing hardware, the original source code so that the two or more portions of the original source code are batched together removing instances of redundant power cycling, thereby creating modified source code from which the one or more power-consuming hardware components are operated in a more power efficient manner. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer-implemented method comprising:
-
inputting, by computing hardware, original source code for an application that requests operation of one or more power-consuming hardware components; analyzing, by the computing hardware, the original source code to identify portions of the original source code that request operation of a power-consuming resource for a task but fail to release the power-consuming resource after the task is completed, wherein the analyzing comprises; identifying a first union of multiple conditions specified in the original source code upon which the power-consuming resource is acquired; identifying a second union of multiple conditions specified in the original source code upon which the power-consuming resource is released; and evaluating a set difference between the first union and the second union, to determine as a resource leak one or more conditions upon which the power-consuming resource is acquired but not released; and modifying, by the computing hardware, the original source code by inserting a code portion that releases the power-consuming resource after the task is completed. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A computer-implemented method comprising:
-
inputting, by computing hardware, original source code for an application that invokes operation of one or more power-consuming components; analyzing, by the computing hardware, the original source code to identify an instance of a stability redundancy in the original source code, the stability redundancy causing unnecessary processing to be performed during execution of two successive calls to a program object because one or more variables or values acted on by the two successive calls to the program object remain stable between the two successive calls; and modifying, by the computing hardware, the original source code to reduce the amount of unnecessary processing performed during the execution of the two successive calls to the program object, wherein the modifying comprises, subsequent to the analyzing, inserting one or more code segments into the original source code that create a tracking variable or tracking flag that tracks at runtime whether a respective one of the variables or values has been updated. - View Dependent Claims (20, 21, 22, 23, 24, 25)
-
Specification