perf(compress): optimize short logs by bypass compressing under 128 bytes

This commit is contained in:
duorameng
2026-07-09 20:36:47 +08:00
parent 516a91acc2
commit b67fa5bd58
4 changed files with 64 additions and 10 deletions
+4
View File
@@ -4,6 +4,10 @@ import { decompress } from 'fzstd'
export function decompressFromBase64(compressed: string): string {
if (!compressed) return ''
try {
if (compressed.startsWith('raw:')) {
return compressed.slice(4)
}
let isZstd = false
let dataToDecode = compressed