Apparatus and method for using database knowledge to optimize a computer program
AssigneeInternational Business Machines Corporation
InventorsEric Lawrence Barsness, Richard Dean Dettinger, John Matthew Santosuosso
Life of this patent
Estimating the term…
Abstract
A code optimizer is used to optimize a computer program that references a database by determining the characteristics of the database and making suitable optimizations based on the characteristics of the database. By taking into account the characteristics of a database referenced in the computer program, the optimizer may make suitable optimizations to the computer program. Such optimizations include, without limitation, removing unnecessary calls to the database, removing unnecessary loops, removing unnecessary database operations, providing compile-time errors, and replacing dynamic calls with static data.
Claims29
An apparatus comprising:
- at least one processor;
- a memory coupled to the at least one processor;
- a first instruction stream residing in the memory;
- and
- a code optimization mechanism residing in the memory and executed by the at least one processor, the code optimization mechanism reading an instruction in the first instruction stream that references a database having metadata, accessing the metadata of the database, and optimizing the first instruction stream to generate therefrom a second instruction stream according to the metadata of the database referenced in the first instruction stream, wherein the code optimization mechanism removes at least one loop from the first instruction stream that is unnecessary as determined by the metadata.
An apparatus comprising:
- at least one processor;
- a memory coupled to the at least one processor;
- a first instruction stream residing in the memory;
- a code optimization mechanism residing in the memory and executed by the at least one processor, the code optimization mechanism querying a database referenced in the first instruction stream to determine database metadata, the code optimization mechanism optimizing the first instruction stream to generate therefrom a second instruction stream according to the database metadata, the code optimization mechanism deleting at least one unnecessary call to the database in the first instruction stream, the code optimization mechanism removing at least one loop from the first instruction stream that is unnecessary as determined by the metadata, the code optimization mechanism removing at least one unnecessary database operation from the first instruction stream, the code optimization mechanism replacing at least one dynamic call in the first instruction stream with static data.
A method for optimizing a first instruction stream comprising the steps of:
- (A) determining metadata of a database referenced in an instruction in the first instruction stream by querying the database;
- and
- (B) optimizing the first instruction stream to generate therefrom a second instruction stream according to the metadata where optimizing comprises removing at least one loop from the first instruction stream that is unnecessary as determined by the metadata.
A method for optimizing a first instruction stream comprising the steps of:
- (A) querying a database referenced in the first instruction stream to determine metadata of the database;
- (B) deleting at least one unnecessary call to the database in the first instruction stream;
- (C) removing at least one loop from the first instruction stream that is unnecessary as determined by the metadata of the database;
- (D) removing at least one unnecessary database operation from the first instruction stream;
- and
- (E) replacing at least one dynamic call in the first instruction stream with static data.
A computer-readable program product stored in storage media, comprising:
- a code optimization mechanism that optimizes a first instruction stream to generate therefrom a second instruction stream according to metadata of a database referenced in the first instruction stream by reading an instruction in the first instruction stream that references the database, accessing the metadata of the database, and optimizing the first instruction stream to generate therefrom a second instruction stream according to the metadata of the database referenced in the first instruction stream, wherein the code optimization mechanism removes at least one loop from the first instruction stream that is unnecessary as determined by the metadata.
Dependencies are inferred from the claim text.