4/10/2026 at 5:07:36 PM
> JIT warmup is real. The first call to any method pays the compilation cost. In a database engine, the first transaction after startup shouldn’t be 100x slower than the steady state.Correct me if I'm wrong but isn't it what aot was supposed to solve?
by benterix
4/10/2026 at 7:47:50 PM
In the section “Hardware-accelerated WAL checksums” he explains how the JIT compiles away the hardware support stuff depending on the exact capabilities of the system its on. With AOT you don’t get this - it’s way more coarse like x64 vs ARMby nycdotnet
4/10/2026 at 6:40:14 PM
AOT is a little fussy in real-world usage particularly for things like reflection. You can probably force it to work but it may make your code much uglier.Span<T> is more important for performance TBH JIT warmup isn't a huge issue for a long-running process
by landl0rd
4/10/2026 at 6:44:18 PM
> ...but it may make your code much uglier
Flip side is that if you use more source generation, it may end up making the code more terse/"prettier" where it matters and avoid the reflection hit.AI agents seem fairly good at generating source generators so there doesn't seem to be a reason to not use them.
by CharlieDigital
4/10/2026 at 7:15:31 PM
With UnsafeAccessor you can often avoid reflection.by sebazzz
4/10/2026 at 7:31:35 PM
What's fussy about AOT and reflection?by orphea
4/10/2026 at 8:24:38 PM
Only a subset of reflection is actually AoT safe, and you can run into issues like "the method you wanted to call wasn't statically referenced anywhere, so there is no compiled implementation of it".by pjc50
4/10/2026 at 10:55:35 PM
That's due to trimming which can be also be enabled for self-contained builds that use JIT compilation. Trimming is mandatory for AOT though. But you can use annotations to prevent trimming of specific thing.AOT doesn't support generating new executable code at runtime (Reflection.Emit), like you can do in JIT mode.
by zigzag312
4/10/2026 at 8:30:48 PM
Eh, I don't see that as a huge deal because the first thing the DB has to do is warm up the disk cache, at least for the indexes. Of course the first call is slow.by pjc50