Skip to content

Commit

Permalink
feat: expand export buffer size from 64kb to 2mb (#566)
Browse files Browse the repository at this point in the history
* enhancement: expand bufio scanner buffer size from 64kb to 2mb to accommodate longer fields in exports

* chore: create export-buffer.md

---------

Co-authored-by: Nicolas Paton <nicolas.paton@gmail.com>
  • Loading branch information
malsobay and npaton authored Jun 23, 2024
1 parent 0cf63f4 commit bc4ede4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/export-buffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@empirica/core": patch
---

Expand export buffer size from 64kb to 2mb
2 changes: 2 additions & 0 deletions internal/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func prepare(tajfile string) ([]*Kind, error) {
scopeKinds := make(map[string]*Kind)

scanner := bufio.NewScanner(file)
buf := make([]byte, 0, 2048*1024)
scanner.Buffer(buf, 2048*1024)

for scanner.Scan() {
line := scanner.Text()
Expand Down

0 comments on commit bc4ede4

Please sign in to comment.