Improve backup export speed

This commit is contained in:
Fedor Indutny
2026-03-11 17:12:27 -07:00
committed by GitHub
parent 52ba69a6f2
commit 979497cea3
6 changed files with 77 additions and 16 deletions

View File

@@ -20,6 +20,11 @@ export function unicodeSlice(
begin: number,
end: number
): string {
// Optimization: whole string fits into the range, return as is
if (begin === 0 && end >= input.length) {
return input;
}
// Until https://chromium-review.googlesource.com/c/v8/v8/+/4190519 is merged,
// we should limit the input size to avoid allocating tons of memory.
// This should be longer than any max length we'd expect to slice.