3 ms·
It's not precisely "self modifying code" but FYI various systems are starting to use LLVM to specialize code at runtime (aka "JIT"), including Postgres, which i
by asah 5y ago
It's not precisely "self modifying code" but FYI various systems are starting to use LLVM to specialize code at runtime (aka "JIT"), including Postgres, which is written in old school C.
In the case of Postgres, the code is modified to precisely work for the particular SQL expression and for the particular table schema. This magic is on by default, which means 100 million+ computers are doing this right now. 25-40% speedups on certain queries.
This concept was first inspired in the 1990s by folks like Henry Massalin, and confirmed at Berkeley and elsewhere, but wasn't considered practical until LLVM came along.
Mic drop and mind blown.
https://severalnines.com/database-blog/overview-just-time-compilation-jit-postgresql https://severalnines.com/database-blog/overview-just-time-co...
https://www.postgresql.org/docs/current/jit.html https://www.postgresql.org/docs/current/jit.html
https://www.postgresql.org/docs/current/jit-reason.html#JIT-ACCELERATED-OPERATIONS https://www.postgresql.org/docs/current/jit-reason.html#JIT-...
https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.29.4871 https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.29....
https://www2.eecs.berkeley.edu/Pubs/TechRpts/1994/6310.html https://www2.eecs.berkeley.edu/Pubs/TechRpts/1994/6310.html
- pjmlp 5y agoOracle and SQL Server have been using JIT for quite some time, no need to wait for LLVM.