Skip to content

Commit

Permalink
File Reader: start with smaller batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
tyt2y3 committed Nov 12, 2023
1 parent e1e553c commit 3a308ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sea-streamer-file/sea-streamer-file-reader/src/subprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async function run() {
}
global.state = State.Running as State;
const source = global.source!;
const batchSize = 100;
let batchSize = 1;
const buffer = [];
let ended = false;

Expand All @@ -160,6 +160,11 @@ async function run() {
break;
}
}
if (batchSize < 10) {
batchSize += 1;
} else if (batchSize < 100) {
batchSize += 10;
}
if (global.state as State === State.PreSeek) { global.state = State.Seeking as State; return; }
for (const messages of splitArray(buffer, 10)) {
// for some reason, I can't send messages in batch of 100 on MacOS
Expand Down

0 comments on commit 3a308ab

Please sign in to comment.