Skip to content

Commit

Permalink
Explain why we need to stream and why not use readline
Browse files Browse the repository at this point in the history
  • Loading branch information
asgerf committed Nov 19, 2024
1 parent 2cde3b9 commit bb1da9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extensions/ql-vscode/src/common/jsonl-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export async function readJsonlFile<T>(
handler: (value: T) => Promise<void>,
logger?: { log: (message: string) => void },
): Promise<void> {
// Stream the data as large evaluator logs won't fit in memory.
// Also avoid using 'readline' as it is slower than our manual line splitting.
void logger?.log(
`Parsing ${path} (${(await stat(path)).size / 1024 / 1024} MB)...`,
);
Expand Down

0 comments on commit bb1da9c

Please sign in to comment.