dmitry-chirkov-dremio commented on PR #49421: URL: https://github.com/apache/arrow/pull/49421#issuecomment-3998091966
## Performance Benchmark Results Benchmarks run on Apple M3, 5 repetitions each. Tests exercise `castVARCHAR` for Int32/Int64 with various `len` parameters. **Test data:** - `Int32` / `Int64`: Full-range random integers (1M rows) - `Int32Small` / `Int64Small`: 2-digit integers 10-99 (1M rows) ### Int32 (Full-Range Random) | len | Original (μs) | Optimized (μs) | Δ | |-----|---------------|----------------|---| | 1 | 17,200 | 16,856 | **-2.0%** ✅ | | 11 | 18,856 | 18,977 | +0.6% | | 100 | 19,088 | 18,819 | **-1.4%** ✅ | | 65536 | 18,792 | 18,951 | +0.8% | ### Int32 (Small 2-Digit) | len | Original (μs) | Optimized (μs) | Δ | |-----|---------------|----------------|---| | 1 | 11,791 | 11,062 | **-6.2%** ✅ | | 11 | 12,461 | 11,756 | **-5.7%** ✅ | | 100 | 12,606 | 11,878 | **-5.8%** ✅ | | 65536 | 12,353 | 11,912 | **-3.6%** ✅ | ### Int64 (Full-Range Random) | len | Original (μs) | Optimized (μs) | Δ | |-----|---------------|----------------|---| | 1 | 17,801 | 17,246 | **-3.1%** ✅ | | 20 | 19,785 | 19,010 | **-3.9%** ✅ | | 100 | 19,268 | 19,439 | +0.9% | | 65536 | 19,688 | 18,950 | **-3.7%** ✅ | ### Int64 (Small 2-Digit) | len | Original (μs) | Optimized (μs) | Δ | |-----|---------------|----------------|---| | 1 | 11,747 | 11,255 | **-4.2%** ✅ | | 20 | 12,581 | 11,435 | **-9.1%** ✅ | | 100 | 12,357 | 11,728 | **-5.1%** ✅ | | 65536 | 12,586 | 11,796 | **-6.3%** ✅ | **Memory savings:** Allocates 11-20 bytes per integer instead of up to 65,536 bytes — a **3,000x reduction** in typical VARCHAR(65536) usage. -- 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]
