0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/packages/start-client-core/src
Flo c59788ca20
perf(start-client-core): O(1) buffer drain in client frame decoder (#8009)
The frame decoder dropped consumed chunks from its buffer with
bufferList.shift(), which is O(n). When a single large frame (e.g. a big
RawStream payload) is assembled from many small network reads, the
extract loop calls shift() once per chunk, making reassembly O(n^2).

Track the first un-consumed chunk with a head pointer and advance it in
O(1) instead of shifting. Consumed slots are released for GC, and the
buffer is compacted when fully drained (O(1) reset) or once the consumed
prefix grows past a small threshold (amortized O(1) per chunk).

A micro-benchmark draining 1000 small chunks is ~11x faster.

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
History 2026-08-08 19:20:41 +02:00
..
client fix(router-core): lane match loader rewrite (#7805) 2026-08-04 20:28:11 +02:00
client-rpc perf(start-client-core): O(1) buffer drain in client frame decoder (#8009) 2026-08-08 19:20:41 +02:00
fake-entries fix(start): avoid encoded virtual adapter ids in vite dev (#7484) 2026-05-25 01:01:47 +02:00
hydration perf(start): compact deferred hydration private state (#7980) 2026-08-07 17:30:30 +02:00
tests rename inputValidator to validator (#7566) 2026-06-06 23:05:56 +02:00
constants.ts feat(start-core): add method and serverFnMeta property to ServerFnCtx (#6394) 2026-01-17 16:17:20 +01:00
createCsrfMiddleware.ts fix: revert plugin changes, createCsrfMiddleware compilation, fix HMR tests (#7400) 2026-05-15 16:35:59 +02:00
createMiddleware.ts rename inputValidator to validator (#7566) 2026-06-06 23:05:56 +02:00
createServerFn.ts rename inputValidator to validator (#7566) 2026-06-06 23:05:56 +02:00
createStart.ts chore: remove unnecessary type assertions (#6365) 2026-02-21 11:29:18 +01:00
empty-plugin-adapters.ts fix(start): avoid encoded virtual adapter ids in vite dev (#7484) 2026-05-25 01:01:47 +02:00
getDefaultSerovalPlugins.ts efp (#7144) 2026-04-11 01:43:05 +02:00
getGlobalStartContext.ts fix: compiler plugin (#6177) 2025-12-22 14:57:50 +01:00
getRouterInstance.ts fix: compiler plugin (#6177) 2025-12-22 14:57:50 +01:00
getStartContextServerOnly.ts fix: compiler plugin (#6177) 2025-12-22 14:57:50 +01:00
getStartOptions.ts fix: compiler plugin (#6177) 2025-12-22 14:57:50 +01:00
global.ts feat: Start RC (#5189) 2025-09-23 11:34:54 -06:00
hydration.ts feat: deferred hydration (#7362) 2026-05-19 18:43:00 +02:00
index.tsx feat(start): CSRF middleware (#7373) 2026-05-09 18:34:24 +02:00
safeObjectMerge.ts fix: refactor middleware (#5517) 2025-12-27 01:06:32 +01:00
serverRoute.ts feat: pass routeId into context/beforeLoad (#6579) 2026-02-03 00:59:12 +01:00
start-entry.d.ts feat: early hints (#7324) 2026-05-02 23:35:52 +02:00
startEntry.ts feat: Start RC (#5189) 2025-09-23 11:34:54 -06:00