pglite
pglite copied to clipboard
parseResults copies the full parser map on every query
parseResults builds its parser lookup with { ...defaultParsers, ...options?.parsers } on every query (packages/pglite/src/parse.ts:24). With array types loaded that's 412 keys, about 30 µs per query, and in my test suite it was 13 to 16% of each worker's CPU. Changing it to Object.assign(Object.create(defaultParsers ?? null), options?.parsers) keeps the same lookups through the prototype and skips the copy. On 0.5.10 that took my suite from 868 s to 771 s of CPU, with all 3,383 tests passing. Happy to open a PR if you'd like.
Built and tested with Claude Opus 5.5.
Thanks, will be done in #1178