Marginalia Search index optimization
Marginalia Search's index code is being rewritten for speed, benchmarking at least twice as fast as the previous version. Production rollout stalled because the new code is four times slower for the simplest queries, apparently due to page thrashing in the mmap-based index readers, so the work now includes implementing a custom buffer pool to manage reads directly.
What it addresses
The faster index code is four times as slow as the prior version for the simplest, fastest queries in production, pushing them past their timeout values, likely because the new code causes more page thrashing in the mmap-based index readers.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
Marginalia Search index optimization
Marginalia Search's index code is being rewritten for speed, benchmarking at least twice as fast as the previous version. Production rollout stalled because the new code is four times slower for the simplest queries, apparently due to page thrashing in the mmap-based index readers, so the work now includes implementing a custom buffer pool to manage reads directly.
Problem: The faster index code is four times as slow as the prior version for the simplest, fastest queries in production, pushing them past their timeout values, likely because the new code causes more page thrashing in the mmap-based index readers.
Posted by @marginalia_nu · Original source ↗
Source text · @marginalia_nu · · Source ↗
Optimizing the Marginalia Search index code. The new code is at least twice as fast in benchmarks, but I can't run it in production because it turns out when you do it's four times as slow as what came before it for the queries that are the simplest and fastest to the point where queries exceed their timeout values by a lot.