LibreChat/packages/api
Marco Beretta 43cf2b91d7
perf(import): make tree repair linear and drop the shifting BFS queue
breakCycles allocated a Set per message and re-walked the whole ancestor
chain, measuring 1.06s for a single 5,000-message conversation and 5.1s at
10,000 - sizes a long real thread reaches. Colouring each node once makes it
linear, and it now roots the message that actually closes the loop instead
of whichever one the outer iteration started from, so a descendant of a
cycle keeps its parent.

enforceOrdering walked its queue with shift(), which re-indexes the whole
remaining array each step and turns a single BFS quadratic on a wide tree.
Conversion is synchronous, so that stalls unrelated requests.
2026-08-02 02:02:44 +02:00
..
src perf(import): make tree repair linear and drop the shifting BFS queue 2026-08-02 02:02:44 +02:00
types
.gitignore
babel.config.cjs
jest.config.mjs 📦 chore: update sanitize-html to latest (#14573) 2026-08-01 09:35:57 -04:00
jest.setup.cjs
package.json 📦 chore: update sanitize-html to latest (#14573) 2026-08-01 09:35:57 -04:00
tsconfig-paths-bootstrap.mjs
tsconfig.build.json
tsconfig.json
tsconfig.spec.json
tsdown.config.mjs 🌀 ci: Deterministic Circular Dependency Checks (#14579) 2026-08-01 14:43:26 -04:00