In an example there is provided a computer-implemented method comprising generating an execution plan for a received user query in a structured query language, the execution plan having a number of operators for operating on data from a content database; compiling the operators into corresponding byte code and machine code; executing the operators by first interpreting the corresponding byte code; switching to executing the operators by executing the corresponding machine code when compiled.
Legal claims defining the scope of protection. Each claim is shown in both the original legal language and a plain English translation.
1. A computer-implemented method comprising: generating an execution plan for a received user query in a structured query language, the execution plan having a number of operators for operating on data from a content database; compiling the execution plan into corresponding byte code and executing the execution plan by interpreting the corresponding byte code; compiling at least some of the operators of the execution plan into machine code at a time overlapping with compiling the execution plan into byte code and interpreting said byte code; switching executing the execution plan by interpreting the byte code to executing the at least some of the operators by executing the corresponding machine code when the compiling the at least some operators into machine code has completed.
This invention relates to optimizing query execution in database systems. The problem addressed is the inefficiency in traditional query processing where execution plans are either fully interpreted or fully compiled, leading to suboptimal performance. The solution involves a hybrid approach that combines bytecode interpretation with selective machine code compilation for certain operators in an execution plan. The method begins by generating an execution plan for a structured query language (SQL) query, where the plan includes multiple operators for processing data from a content database. The execution plan is compiled into bytecode, which is then interpreted to execute the query. Concurrently, at least some of the operators in the execution plan are compiled into machine code while the bytecode is being interpreted. Once the machine code compilation is complete, the system switches from interpreting the bytecode to executing the machine code for those operators. This hybrid approach reduces execution time by leveraging the efficiency of machine code for critical operations while maintaining flexibility through bytecode interpretation. The overlapping compilation and execution phases ensure minimal latency and improved overall performance.
2. The method of claim 1 , wherein executing a said operator comprises an Interpreter checking a flag indicating completion of the machine code corresponding to the operator and calling the compiled machine code operator if completed or jumping to the byte code corresponding to the operator.
This invention relates to a system for executing operators in a computing environment, addressing the challenge of efficiently managing the transition between interpreted and compiled code execution. The system involves an interpreter that processes operators, which can be either interpreted or compiled into machine code. When an operator is encountered, the interpreter checks a flag to determine whether the corresponding machine code has been fully compiled. If the machine code is ready, the interpreter directly invokes the compiled operator. If not, the interpreter executes the operator by interpreting its bytecode. This approach optimizes performance by avoiding redundant compilation steps while ensuring seamless execution of both interpreted and compiled code. The system dynamically adapts to the state of the operator, reducing overhead and improving execution efficiency. The method ensures that operators are executed in the most efficient manner available, whether through compiled machine code or interpreted bytecode, based on their current compilation status. This hybrid execution model enhances flexibility and performance in environments where code may be dynamically compiled or interpreted.
3. The method of claim 2 , further comprising compiling the operator into helper machine code and wherein executing the operator comprises the Interpreter: interpreting the byte code corresponding to the operator; within a loop of the byte code checking a flag indicating completion of the helper machine code corresponding to the operator: calling the compiled helper machine code operator if completed or continuing interpreting the loop.
This invention relates to optimizing the execution of operators in a virtual machine environment, particularly for systems that use both interpreted bytecode and compiled machine code. The problem addressed is the inefficiency of repeatedly interpreting the same bytecode instructions, which can slow down performance in virtual machines that rely on dynamic compilation. The method involves compiling frequently used operators into helper machine code to improve execution speed. When an operator is encountered, the interpreter first checks if the corresponding helper machine code has been compiled. If the helper code is available, the interpreter calls it directly, bypassing further bytecode interpretation. If the helper code is not yet compiled, the interpreter continues interpreting the bytecode in a loop until the compilation is completed. This approach ensures that once an operator is compiled, subsequent executions benefit from the faster machine code, while still maintaining the flexibility of interpreted bytecode for initial or infrequent operations. The method also includes a flag mechanism to track the compilation status of each operator, allowing the interpreter to efficiently determine whether to call the compiled helper code or continue interpreting the bytecode. This hybrid approach balances performance and flexibility, making it suitable for virtual machines that need to handle both interpreted and compiled code efficiently.
4. The method of claim 1 , further comprising compiling one or more functions into machine code and generating a machine code wrapper for each function, and wherein interpreting said functions called in the byte code by calling the respective wrapper.
This invention relates to a system for executing functions in a computing environment, particularly where functions are compiled into machine code and executed via wrappers. The problem addressed is the inefficiency of interpreting bytecode directly, which can slow down execution. The solution involves compiling functions into machine code and generating a machine code wrapper for each function. When a function is called in the bytecode, the corresponding wrapper is invoked to execute the machine code version of the function. This approach improves performance by reducing interpretation overhead while maintaining compatibility with bytecode-based execution models. The system may also include a runtime environment that manages the execution of bytecode and the invocation of machine code wrappers. The wrappers handle the transition between bytecode and machine code, ensuring seamless execution. This method is particularly useful in environments where performance is critical, such as just-in-time compilation or hybrid execution systems. The invention optimizes function execution by leveraging compiled machine code while retaining the flexibility of bytecode interpretation.
5. The method of claim 4 , wherein the wrappers initially comprise a no op which is replaced when the corresponding function is compiled with a jump instruction to the compiled function.
A system and method for optimizing function calls in a programming environment involves dynamically replacing placeholder wrappers with optimized jump instructions during compilation. The technique addresses inefficiencies in function call handling, particularly in interpreted or just-in-time compiled languages, where traditional function calls introduce overhead. Initially, each function is associated with a wrapper that performs no operation (no-op). During compilation, these no-op wrappers are replaced with direct jump instructions to the compiled function's entry point. This replacement eliminates the need for additional indirection, reducing call overhead and improving execution speed. The method ensures that function calls are resolved at compile time, allowing the compiler to generate more efficient machine code. The approach is particularly useful in environments where functions are frequently called, such as in performance-critical applications or frequently executed code paths. By replacing no-op wrappers with direct jumps, the system minimizes the runtime overhead associated with function dispatch, leading to faster execution and better resource utilization. The technique can be applied to various programming languages and compilation frameworks, enhancing performance without requiring changes to the source code.
6. The method of claim 1 , wherein variables used by the byte code corresponding to an operator are copied into a buffer for use by the compiled machine code corresponding to the operator.
This invention relates to optimizing the execution of bytecode in a virtual machine by improving the handling of variables used by operators. The problem addressed is the inefficiency in accessing variables during bytecode interpretation, which can slow down execution. The solution involves copying variables used by a bytecode operator into a buffer before generating the corresponding machine code. This pre-copying step allows the compiled machine code to directly access the variables from the buffer, reducing overhead and improving performance. The method ensures that the variables are available in a contiguous memory location, minimizing memory access latency and enhancing execution speed. The technique is particularly useful in just-in-time (JIT) compilation environments where bytecode is dynamically translated into machine code for faster execution. By pre-copying variables into a buffer, the system avoids repeated memory lookups and reduces the overhead associated with variable access during runtime. This optimization is applicable to various virtual machines and programming languages that rely on bytecode interpretation or JIT compilation. The invention aims to streamline the execution process by minimizing the overhead of variable access, leading to more efficient and faster program execution.
7. The method of claim 1 , wherein compiling the operators into corresponding byte code or machine code comprises loading byte code or machine code corresponding to the operators from a codebase.
A system and method for optimizing the execution of operators in a computing environment. The technology addresses the inefficiency of interpreting or recompiling operators during runtime, which can slow down performance. The method involves compiling operators into corresponding bytecode or machine code to enable faster execution. Specifically, the method includes loading pre-compiled bytecode or machine code for the operators from a centralized codebase, eliminating the need for runtime compilation. This approach reduces latency and improves processing speed by reusing pre-compiled code. The system may also include a codebase that stores the pre-compiled bytecode or machine code for quick retrieval. The method ensures that operators are executed efficiently by leveraging pre-compiled instructions, which are optimized for performance. This technique is particularly useful in environments where rapid execution of operators is critical, such as in data processing, real-time systems, or high-performance computing. The method may also include additional steps such as validating the operators before compilation and managing the codebase to ensure the latest versions of the operators are used. The overall system enhances computational efficiency by minimizing runtime overhead associated with operator execution.
8. A database management system comprising: a memory; a storage engine to control writing and retrieval of data between the memory and a database; a query and execution engine to: generate an execution plan in the memory from a user query, the execution plan having a number of operators for operating on data from the database; compile the execution plan into byte code and execute the execution plan by interpreting the byte code; compile at least some operators of the execution plan into machine code at a time overlapping with compiling the execution plan into byte code and interpreting said byte code; switch from executing the execution plan by interpreting the byte code to executing the at least some of the operators by executing the machine code corresponding to the at least some of the operators when the machine code corresponding to the at least some operators has finished compiling.
This invention relates to database management systems, specifically optimizing query execution performance. The system includes a memory, a storage engine for managing data between the memory and a database, and a query and execution engine. The query and execution engine generates an execution plan from a user query, where the plan consists of multiple operators for processing database data. The execution plan is compiled into byte code and executed by interpreting this byte code. Concurrently, at least some operators within the execution plan are compiled into machine code while the byte code is being interpreted. Once the machine code compilation is complete, the system switches from interpreting the byte code to executing the machine code for those operators. This approach improves performance by leveraging faster machine code execution for frequently used or performance-critical operators while maintaining flexibility through byte code interpretation for the rest of the plan. The system dynamically balances compilation overhead and execution speed, optimizing overall query performance.
9. The system of claim 8 , further comprising an Interpreter to interpret byte code corresponding to the execution plan including to check a flag indicating completion of machine code corresponding to an operator and to call the compiled machine code if completed or to jump to byte code corresponding to the operator.
A system for optimizing the execution of database queries involves generating an execution plan for a query, compiling the plan into machine code for efficient execution, and managing the transition between bytecode and machine code during runtime. The system includes a compiler that converts the execution plan into machine code, optimizing performance by reducing interpretation overhead. An interpreter module interprets bytecode corresponding to the execution plan, checking a flag to determine whether machine code for a specific operator has been completed. If the machine code is ready, the interpreter calls the compiled machine code for execution. If not, the interpreter jumps to the bytecode corresponding to the operator, allowing the system to continue processing while the machine code is being compiled in the background. This approach ensures seamless execution by dynamically switching between bytecode and machine code, improving query performance without requiring full compilation before execution. The system dynamically manages the transition between interpreted and compiled code, optimizing resource usage and execution speed.
10. The system of claim 8 , the query and execution engine to compile the operators into corresponding helper machine code; the Interpreter to interpret the byte code corresponding to a said operator and within a loop of the byte code to check a flag indicating completion of the helper machine code corresponding to the operator, and to call the compiled helper machine code operator if completed or to jump to the start of the byte code loop.
This invention relates to a system for optimizing the execution of operators in a data processing environment. The system addresses the inefficiency in traditional interpreter-based execution, where operators are repeatedly interpreted without leveraging compiled machine code for faster execution. The system includes a query and execution engine that compiles operators into corresponding helper machine code, enabling faster execution once compiled. An interpreter is used to interpret byte code corresponding to each operator. During execution, the interpreter checks a flag within a loop of the byte code to determine if the helper machine code for the operator has been compiled. If the helper machine code is available, the interpreter calls the compiled version for execution. If not, the interpreter jumps back to the start of the byte code loop, allowing the operator to be processed in interpreted mode until the helper machine code is ready. This hybrid approach combines the flexibility of interpretation with the performance benefits of compiled code, improving overall system efficiency. The system dynamically switches between interpreted and compiled execution based on the availability of the compiled helper machine code, ensuring optimal performance without requiring manual intervention.
11. The system of claim 8 , further comprising an Interpreter and wherein the query and execution engine to compile one or more functions into machine code and to generate a machine code wrapper for each function, the Interpreter to interpret said functions called in the byte code by calling the respective wrapper.
A system for executing functions in a computing environment involves a query and execution engine that compiles one or more functions into machine code and generates a machine code wrapper for each function. The system also includes an interpreter that interprets functions called in bytecode by invoking the corresponding machine code wrapper. This approach combines the efficiency of compiled machine code with the flexibility of interpreted execution. The system is designed to optimize performance by reducing the overhead associated with interpreting bytecode directly, while maintaining the ability to dynamically execute functions as needed. The interpreter handles the dynamic invocation of functions, ensuring compatibility with interpreted environments while leveraging pre-compiled machine code for faster execution. This hybrid approach is particularly useful in systems where both performance and flexibility are critical, such as in virtual machines, scripting engines, or just-in-time compilation environments. The system may be part of a larger framework that processes and executes code, where the query and execution engine manages the compilation and execution pipeline, and the interpreter bridges the gap between interpreted and compiled code execution.
12. The system of claim 11 , wherein the wrappers initially comprise a no op which is replaced when the corresponding function is compiled with a jump instruction to the compiled function.
The system relates to a software compilation and execution framework designed to optimize function calls in a programming environment. The problem addressed is the inefficiency in function call handling, particularly during the initial stages of program execution, where function calls may not yet be fully optimized or resolved. The system includes a set of wrappers associated with functions in a program. Initially, these wrappers contain a no-op (no operation) instruction, which serves as a placeholder. When a function is compiled, the no-op is dynamically replaced with a jump instruction that redirects execution to the compiled version of the function. This approach ensures that function calls are efficiently resolved at runtime, reducing overhead and improving performance. The system further includes a compiler that processes the functions and generates the necessary jump instructions. The wrappers act as intermediaries, allowing the program to handle function calls seamlessly, even before the functions are fully compiled. This mechanism is particularly useful in just-in-time (JIT) compilation environments, where functions are compiled on-demand during execution. By replacing no-ops with jump instructions, the system minimizes the latency associated with function resolution and ensures that compiled functions are executed directly, without additional indirection. This optimization enhances the overall efficiency of the program, particularly in scenarios where functions are frequently called or dynamically loaded.
13. The system of claim 12 , wherein the wrappers comprise a call to the byte code for the function after the no op.
The invention relates to a system for optimizing software execution by modifying bytecode to include non-operational (no-op) instructions and function calls. The system addresses inefficiencies in software execution where function calls may introduce unnecessary overhead or delays. The wrappers, which are part of the system, include a call to the bytecode for the function immediately following a no-op instruction. This structure allows the system to manage function execution more efficiently, potentially reducing latency or improving performance by controlling when and how functions are invoked. The no-op instruction serves as a placeholder or delay mechanism, ensuring proper timing or synchronization before the function call is executed. The system may be used in environments where precise control over function execution is required, such as in real-time systems, performance-critical applications, or scenarios where function calls must be carefully timed to avoid conflicts or resource contention. The wrappers may also include additional logic to further optimize or manage the function call process, such as pre- or post-processing steps. The overall system aims to enhance software performance by strategically inserting no-ops and function calls in the bytecode to achieve desired execution behavior.
14. The system of claim 8 , wherein the memory comprises buffers to copy variables used by the byte code corresponding to an operator for use by the compiled machine code corresponding to the operator.
This invention relates to a system for optimizing the execution of bytecode in a computing environment. The system addresses the inefficiency that arises when bytecode, which is an intermediate representation of program instructions, is interpreted or compiled at runtime. The problem is particularly pronounced when bytecode operations require frequent access to variables, leading to performance bottlenecks due to repeated memory access and context switching between bytecode and compiled machine code. The system includes a memory with buffers specifically designed to store variables used by bytecode operators. These buffers allow the variables to be directly accessible by the corresponding compiled machine code, eliminating the need for repeated memory lookups. By pre-copying the variables into these buffers, the system reduces the overhead associated with variable access during execution. The buffers are dynamically managed to ensure that the most frequently used variables are readily available, further improving performance. This approach minimizes the latency introduced by interpreting or compiling bytecode on the fly, resulting in faster execution times and more efficient resource utilization. The system is particularly useful in environments where bytecode is extensively used, such as virtual machines or just-in-time compilation systems.
15. The system of claim 8 , further comprising a codebase to store for reuse compiled byte code and machine code corresponding to the operators.
A system for optimizing computational operations in a data processing environment addresses inefficiencies in executing repetitive or frequently used operations. The system includes a compiler that translates high-level programming constructs into intermediate byte code and further into machine code for execution on a processor. To enhance performance, the system stores compiled byte code and machine code in a reusable codebase, allowing subsequent operations to reuse pre-compiled code rather than recompiling from scratch. This reduces computational overhead and improves execution speed. The system dynamically retrieves stored code from the codebase when similar operations are encountered, ensuring efficient reuse. The codebase may be organized to index compiled code by operator type or other identifiers, enabling quick lookup and retrieval. This approach minimizes redundant compilation steps, particularly beneficial in environments where the same operations are performed repeatedly, such as in data processing pipelines or iterative algorithms. The system may also include mechanisms to update or invalidate stored code when underlying definitions or dependencies change, maintaining consistency and correctness. By leveraging pre-compiled code, the system significantly reduces latency and resource consumption during operation execution.
16. A computer readable medium comprising instructions that, when executed by a processor of a computer, cause a computer comprising the processor to: generate an execution plan for a received user query in a structured query language, the execution plan having a number of operators for operating on data from a content database; compile the execution plan into corresponding byte code and executing said execution plan; by interpreting the corresponding byte code; compile at least some operators of the execution plan into machine code at a time overlapping with compiling the execution plan into byte code and interpreting said byte code; switch from executing the execution plan by interpreting the byte code to executing to executing the at least some operators by executing the corresponding machine code has completed compiling.
This invention relates to database query processing, specifically optimizing the execution of structured query language (SQL) queries by dynamically switching between bytecode interpretation and machine code execution. The problem addressed is the inefficiency in traditional query execution systems, which either rely solely on bytecode interpretation (slower execution) or pre-compile all operators to machine code (higher overhead and latency). The solution involves a hybrid approach where an execution plan for an SQL query is initially compiled into bytecode and executed via interpretation. Concurrently, selected operators from the execution plan are compiled into machine code. Once the machine code compilation is complete, execution seamlessly transitions from bytecode interpretation to machine code execution for those operators. This dynamic switching balances performance and resource usage, improving query execution speed while reducing compilation overhead. The system dynamically determines which operators to compile into machine code based on factors such as operator complexity, frequency of use, or expected performance gains. The invention is implemented in a computer system with a processor executing instructions stored on a computer-readable medium.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
October 31, 2019
March 29, 2022
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.