Dynamically switching between execution paths for user-defined functions
AssigneeInternational Business Machines Corporation
InventorsAndrei F. Lurie, Dirk Nakott, Johannes Schuetzner
Life of this patent
Estimating the term…
Abstract
Dynamically switching between a plurality of execution paths to execute a function, such as a user-defined function. The plurality of execution paths include an execution path that uses caching and another execution path that uses inlining. A user-defined function is executed at least once using a first execution path. Then, for a later execution of the function, the execution path is automatically switched to a second execution path.
Claims13
A computer program product for facilitating processing within a computing environment, said computer program product comprising:
- a computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
- executing a function using a first execution path;
- obtaining the function to be executed a next time;
- determining, based on obtaining the function, whether the first execution path is to be used to execute the function the next time, comprising:
- checking whether use of a result cache associated with the function is effective;
- and
- choosing not to use the first execution path based on the checking indicating use of the result cache is ineffective;
- automatically switching to a second execution path, based on determining the first execution path is not to be used, wherein the first execution path and the second execution path are supported automatically absent external changes, and wherein the automatically switching to the second execution path occurs absent external changes of internal control structures;
- and
- executing the function using the second execution path, based on automatically switching to the second execution path, wherein the first execution path and the second execution path are determined at preparation time of code that includes the function, wherein the function is a user-defined function, the first execution path uses caching and the second execution path uses inlining.
A computer system for facilitating processing within a computing environment, said computer system comprising:
- a memory;
- and
- a processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
- executing a function using a first execution path;
- obtaining the function to be executed a next time;
- determining, based on obtaining the function, whether the first execution path is to be used to execute the function the next time, comprising:
- checking whether use of a result cache associated with the function is effective;
- and
- choosing not to use the first execution path based on the checking indicating use of the result cache is ineffective;
- automatically switching to a second execution path, based on determining the first execution path is not to be used, wherein the first execution path and the second execution path are supported automatically absent external changes, and wherein the automatically switching to the second execution path occurs absent external changes of internal control structures;
- and
- executing the function using the second execution path, based on automatically switching to the second execution path, wherein the first execution path and the second execution path are determined at preparation time of code that includes the function, wherein the function is a user-defined function, the first execution path uses caching and the second execution path uses inlining.
A computer-implemented method of facilitating processing within a computing environment, said computer-implemented comprising:
- executing, by a processor, a function using a first execution path;
- obtaining the function to be executed a next time;
- determining, based on obtaining the function, whether the first execution path is to be used to execute the function the next time, comprising:
- checking whether use of a result cache associated with the function is effective;
- and
- choosing not to use the first execution path based on the checking indicating use of the result cache is ineffective;
- automatically switching to a second execution path, based on determining the first execution path is not to be used, wherein the first execution path and the second execution path are supported automatically absent external changes, and wherein the automatically switching to the second execution path occurs absent external changes of internal control structures;
- and
- executing the function using the second execution path, based on automatically switching to the second execution path, wherein the first execution path and the second execution path are determined at preparation time of code that includes the function, wherein the function is a user-defined function, the first execution path uses caching and the second execution path uses inlining.
Dependencies are inferred from the claim text.