perf(jsonl): shorten cooperative decode slices
This commit is contained in:
@@ -203,7 +203,7 @@ export function snapshotSessionEvent<T extends SessionEvent>(event: T): T {
|
|||||||
return adoptSessionEvent(structuredClone(event))
|
return adoptSessionEvent(structuredClone(event))
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Deep-freeze one acyclic object tree materialized by JSON parsing. */
|
/** Deep-freeze one acyclic object tree materialized by JSON parsing. input is stackoverflow-safe */
|
||||||
function freezeRestoredObject<T>(value: T): T {
|
function freezeRestoredObject<T>(value: T): T {
|
||||||
Object.freeze(value)
|
Object.freeze(value)
|
||||||
for (const key in value) {
|
for (const key in value) {
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ export type { JsonlCompression } from './format.ts'
|
|||||||
|
|
||||||
const DEFAULT_PACK_CHUNKS = true
|
const DEFAULT_PACK_CHUNKS = true
|
||||||
const DEFAULT_COMPRESSION: JsonlCompression = 'zstd'
|
const DEFAULT_COMPRESSION: JsonlCompression = 'zstd'
|
||||||
const ZSTD_DECODE_YIELD_INTERVAL_MS = 1000
|
/** internal yield interval. */
|
||||||
|
const ZSTD_DECODE_YIELD_INTERVAL_MS = 500
|
||||||
|
|
||||||
/** Assert that the independently decodable first frame contains only the header record. */
|
/** Assert that the independently decodable first frame contains only the header record. */
|
||||||
function assertZstdHeaderFrame(plaintext: Buffer): void {
|
function assertZstdHeaderFrame(plaintext: Buffer): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user