serramatutu commented on PR #833:
URL: https://github.com/apache/arrow-go/pull/833#issuecomment-5618770060

   # Benchmark
   
   Results for `BenchmarkJSONReaderRowShape` in 
`arrow/array/json_reader_test.go`,
   comparing this branch against `main` (`227f6e3e`).
   
   ## Method
   
   I ran it with Go 1.27.0, on an Apple M3 Pro. Every figure below is the 
median of six
   runs of 200 iterations. 
   
   ```
   go test ./arrow/array/ -run XXX -bench BenchmarkJSONReaderRowShape 
-benchtime 200x -count 6
   ```
   
   The test cases:
   
   | shape | rows | fields per row | document size |
   |---|---|---|---|
   | small | 10,000 | 3 | ≈404 KB |
   | medium | 1,000 | 10 | ≈119 KB |
   | large | 1,000 | 100 | ≈1.3 MB |
   
   Every shape runs twice, once with all fields non-nullable and once with all
   fields nullable.
   
   ## Results
   
   TL;DR: the new encoder is a bit slower on small field counts, but it's 
faster for lots of fields. Nullability has no impact on performance.
   
   Non-nullable fields:
   
   | shape | | ns/op | B/op | allocs/op |
   |---|---|---|---|---|
   | small | main | 4,677,199 | 3,210,490 | 100,111 |
   | | branch | 7,011,912 | 10,012,000 | 170,054 |
   | | | 1.50× slower | 3.12× | 1.70× |
   | medium | main | 1,846,820 | 1,243,625 | 34,210 |
   | | branch | 2,011,174 | 1,553,296 | 38,665 |
   | | | 1.09× slower | 1.25× | 1.13× |
   | large | main | 20,324,901 | 16,017,950 | 310,824 |
   | | branch | 18,479,923 | 13,007,674 | 311,132 |
   | | | 1.10× faster | 0.81× | 1.00× |
   
   Nullable fields:
   
   | shape | | ns/op | B/op | allocs/op |
   |---|---|---|---|---|
   | small | main | 4,654,143 | 3,210,490 | 100,111 |
   | | branch | 6,673,585 | 10,011,998 | 170,054 |
   | | | 1.43× slower | 3.12× | 1.70× |
   | medium | main | 1,847,819 | 1,243,625 | 34,210 |
   | | branch | 1,899,604 | 1,553,296 | 38,665 |
   | | | 1.03× slower | 1.25× | 1.13× |
   | large | main | 20,259,187 | 16,017,950 | 310,824 |
   | | branch | 17,333,649 | 13,007,674 | 311,132 |
   | | | 1.17× faster | 0.81× | 1.00× |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to