cyrilou242 opened a new pull request, #3853:
URL: https://github.com/apache/calcite/pull/3853

   This benchmark will help to measure the progress on the discussion here:
   https://lists.apache.org/thread/xw35sdy1w1k8lvn1q1lr7xb93bkj0lpq
   As of today the parsers instantiation is pretty slow and the speed depends 
on the call stack depth. This is an issue caused by JavaCC. The issue is fixed 
in newer version of JavaCC.
   
   Once JavaCC is upgraded to 7.0.13 
(https://issues.apache.org/jira/browse/CALCITE-5541), this benchmark can be 
re-run. 
   Expected improvements are: 
   - a minor speed improvement of ~10% for `instantiateBabelParser` and 
`instantiateCoreParser`
   - the instantiation of parsers should not depend on the call stack depth 
anymore: 
     - `instantiateBabelParser` ~= `instantiateBabelParserInDeepCallStack`
     - `instantiateCoreParser` ~= `instantiateCoreParserInDeepCallStack`
   
   ## Current Results: 
   ```
   Benchmark                                                           
(comments)  (length)  Mode  Cnt    Score   Error  Units
   ParserBenchmark.parseCached                                               
true      1000  avgt    7  126.512 ± 0.299  us/op
   ParserBenchmark.parseNonCached                                            
true      1000  avgt    7   93.536 ± 0.278  us/op
   ParserInstantiationBenchmark.instantiateBabelParser                        
N/A       N/A  avgt    7   14.716 ± 0.174  us/op
   ParserInstantiationBenchmark.instantiateBabelParserInDeepCallStack         
N/A       N/A  avgt    7   21.592 ± 0.614  us/op
   ParserInstantiationBenchmark.instantiateCoreParser                         
N/A       N/A  avgt    7    6.523 ± 0.114  us/op
   ParserInstantiationBenchmark.instantiateCoreParserInDeepCallStack          
N/A       N/A  avgt    7   21.586 ± 0.187  us/op
   ```
   
   (temurin 17, intel macbook)
   
   ## How to run: 
   Add: 
   ```
   jmh {
       includes = listOf("Parser.*Benchmark")
   }
   ```
   To `ubenchmark/build.gradle.kts`  
   Then `./gradlew :ubenchmark:jmh`
   This will run the new `ParserInstantiationBenchmark` and the existing 
`ParserBenchmark`.


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