@slonik/dataloaders@49.10.1
Patch Changes
-
#810
cf370a9Thanks @mikeroelens! - Fix O(n²) record matching increateNodeByIdLoaderClassThe node-by-id DataLoader batches all keys into a single query, but then
matched the returned rows back to the requested keys using
Array.prototype.findinside amap, making the in-memory join O(n²) in the
batch size. For large batches this added significant synchronous, event-loop
blocking CPU time after the query had already returned (e.g. ~800ms for a
10,000-key batch).The rows are now indexed into a
Maponce and looked up in O(1) per key —
mirroring the grouping approach already used inbatchQueries. Behaviour is
unchanged, including first-match-wins semantics for duplicate key values.