# Performance

All types of SingleStore extensions are optimized for high performance. Once created, each is compiled directly to machine code using SingleStore’s unique [code generation](https://docs.singlestore.com/db/v9.1/query-data/advanced-query-topics/code-generation.md) techniques. This process ensures that subsequent execution of a procedure or function is highly performant, as a node can execute the function without requiring interpretation or a multi-step process of intermediate language compilation.

Additionally, stored procedures and table variables benefit from further optimizations for SingleStore’s distributed execution. SQL statements within stored procedures operate with full parallelism across the SingleStore cluster. `QUERY` type variables are processed with a lazy evaluation strategy. The underlying `SELECT` statement associated with a `QUERY` type variable is only executed when the rows of the variable need to be returned. UDFs are also processed in parallel on different data partitions.

***

Modified at: June 22, 2022

Source: [/db/v9.1/developer-resources/procedural-extensions/performance/](https://docs.singlestore.com/db/v9.1/developer-resources/procedural-extensions/performance/)

(An index of the documentation is available at /llms.txt)
