Changelog

Kolofon · 22 September 2026

0.13.23 — vectors on demand

when switching language quickly on a fresh phone ended with error 1102

0.13.23 — vectors on demand

Text: Kolofon

An instance hands semantic vectors to the engine as a glob of JSON modules. Until now it was an eager glob: all vectors went into the main server bundle chunk and were processed together with the rest of the code. In the largest instance that is 3.4 of the chunk's 5 MB — more than two thirds.

The worker processes the main chunk on every cold start, that is, whenever a request lands in a fresh process. This happened for pages that do not use search at all. On a plan with a low CPU time limit, some of those requests ended with error 1102 — easiest to trigger by clicking quickly on a fresh phone, because several parallel requests then landed in new processes.

Since 0.13.23 vector modules can be lazy: the instance passes a glob without `eager: true`, and the engine loads them only on the first search in a given process. The main bundle chunk in the largest instance went from 5 to 1.3 MB. The first search in a new process pays for loading the index, later ones run from memory; two simultaneous searches do not load it twice.

An eager glob still works, so an instance that changes nothing behaves as before. Switching an instance over is one line in `instance.ts`.