1. Field of the Invention
This invention relates in general to accessing a database or executing a command over the Internet, and in particular, to a method and system for enhancing the performance of interpreted Web applications.
2. Description of Related Art
With the fast growing popularity of the Internet and the World Wide Web (also known as xe2x80x9cWWWxe2x80x9d or the xe2x80x9cWebxe2x80x9d), there is also a fast growing demand for Web applications. For example, U.S. Pat. No. 5,737,592 describes a method and apparatus for executing SQL (Structured Query Language) queries in a relational database management system (RDBMS) via the Web. Web users can request information from the RDBMS via HTML (HyperText Markup Language) input forms, which request is then used by an interpreted macro language file to create an SQL statement for execution by the RDBMS. The results output by the RDBMS are themselves transformed using the macro language file into HTML format for presentation to the Web user.
An application that is interpreted when executed offers a high degree of flexibility to developers and installers of the application because any changes that are made to the application take effect immediately. An interpretive execution environment also offers a high degree of flexibility to users, because users can provide input that alters the execution of the application or even make dynamic changes to the application itself at the time they request execution of the application.
However, the performance of interpreted applications is constrained by the parsing costs that are typically incurred for each execution of the application. These costs can be considerable and may limit the usefulness of the applications within production environments, and in particular, within production environments where customer acceptance of the applications is dependent on acceptable response time. Thus, the value of the flexibility described above is lost.
There is a need in the art for techniques that improve the performance of interpreted Web applications without sacrificing the flexibility that this style of application makes available to application programmers, installers, and users of the application.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a system, method, and article of manufacture for caching a pre-processed version of an interpreted application at the time the interpreted application is first interpreted and executed by a computer, thereby improving response time for subsequent executions of the interpreted application. The pre-processed version of the interpreted application captures all execution paths through the interpreted application, despite the fact that the first execution of the interpreted application may only exercise a subset of the possible execution paths therein. Modifications to the interpreted application are dynamically detected, so that the pre-processed version can be replaced in the cache as needed.
Referring now to the drawings in which like reference numbers represent corresponding parts throughout:
FIG. 1 schematically illustrates the hardware and software environment of the preferred embodiment of the present invention;
FIG. 2 schematically illustrates the structure of a macro language file according to the preferred embodiment of the present invention;
FIG. 3 schematically illustrates the structure of a hash table for macro language files according to the preferred embodiment of the present invention;
FIG. 4 schematically illustrates the structure of each entry of the hash table according to the preferred embodiment of the present invention;
FIG. 5 schematically illustrates the structure of a mutex array for the hash table according to the preferred embodiment of the present invention; and
FIGS. 6, 7, and 8 are flowcharts illustrating the logic performed by the Net.Data gateway in interpreting macro language files according to the preferred embodiment of the present invention.