dmitry-chirkov-dremio commented on PR #49439:
URL: https://github.com/apache/arrow/pull/49439#issuecomment-3991513718

   ## Local Benchmark Results
   **Platform:** Apple M3, macOS  
   **Benchmark:** cpp/src/gandiva/tests/micro_benchmarks.cc, 10 repetitions, 1 
million rows per test
   
   The original RPAD was pathologically slow compared to LPAD due to different 
algorithms. For 65K padding: LPAD took ~29ms while RPAD took ~992ms (34x slower 
for identical operation). The optimization applies the same efficient algorithm 
to both functions.
   
   ### LPAD (mean time in μs)
   
   | Benchmark | Original | Optimized | Speedup |
   |-----------|----------|-----------|---------|
   | Minimal (9 padding chars) | 147 | 148 | - |
   | Small (99 padding chars) | 312 | 167 | 1.9x |
   | Medium (100 padding chars) | 368 | 219 | 1.7x |
   | Large (1000 padding chars) | 16,242 | 16,273 | - |
   | XLarge (65436 padding chars) | 29,115 | 27,987 | 1.04x |
   
   ### RPAD (mean time in μs)
   
   | Benchmark | Original | Optimized | Speedup |
   |-----------|----------|-----------|---------|
   | Minimal (9 padding chars) | 247 | 148 | 1.7x |
   | Small (99 padding chars) | 1,704 | 165 | **10x** |
   | Medium (100 padding chars) | 1,773 | 216 | **8x** |
   | Large (1000 padding chars) | 30,813 | 16,082 | 1.9x |
   | XLarge (65436 padding chars) | 992,334 | 27,724 | **36x** |


-- 
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