Improve backup export speed

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2026-03-11 19:59:57 -05:00
committed by GitHub
parent e53d115a4f
commit a27a0a6a9e
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.