The buffer pair a packed numeric column is — for moving one across
an isolate boundary ([PND-PROCPAR]).
RunResult.columns is already described as the wire-shaped answer: a
Float64Array plus a validity bitmap. This makes that literal, so a
worker can hand a result back as two transferable buffers rather than
500k boxed values (48.6 ms per answer boxed vs 0.5 ms transferred).
The buffers are copies, deliberately. A column's own buffers are
shared with the node's memo, and transferring a buffer detaches it in
the sending isolate — which would silently empty the cache the worker
exists to keep warm. One slice() per surfaced column is the price of
the cache staying valid, and it is still the cheap direction.
Falls back to undefined for a column this cannot express (chunked
storage, or a non-numeric kind), so a caller can box that one rather
than the pool failing over a column it did not need packed.
The buffer pair a packed numeric column is — for moving one across an isolate boundary ([PND-PROCPAR]).
RunResult.columnsis already described as the wire-shaped answer: aFloat64Arrayplus a validity bitmap. This makes that literal, so a worker can hand a result back as two transferable buffers rather than 500k boxed values (48.6 ms per answer boxed vs 0.5 ms transferred).The buffers are copies, deliberately. A column's own buffers are shared with the node's memo, and transferring a buffer detaches it in the sending isolate — which would silently empty the cache the worker exists to keep warm. One
slice()per surfaced column is the price of the cache staying valid, and it is still the cheap direction.Falls back to
undefinedfor a column this cannot express (chunked storage, or a non-numeric kind), so a caller can box that one rather than the pool failing over a column it did not need packed.