perf(findr): Use buffered writer.

This commit is contained in:
2026-06-17 12:48:57 -04:00
parent 3e5889d5c0
commit 116ed6de4c
2 changed files with 21 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package findr
import "core:bufio"
import "core:fmt"
import "core:os"
import "core:strings"
@@ -75,7 +76,13 @@ main :: proc() {
thread_count := os.get_processor_core_count()
walk(paths[:], &results, opts, thread_count)
w: bufio.Writer
bufio.writer_init(&w, os.to_stream(os.stdout), 1 << 13)
defer bufio.writer_destroy(&w)
for r in results {
fmt.println(r)
bufio.writer_write_string(&w, r)
bufio.writer_write_byte(&w, '\n')
}
bufio.writer_flush(&w)
}