richardstartin edited a comment on pull request #7402:
URL: https://github.com/apache/pinot/pull/7402#issuecomment-914695077


   The ordering makes some difference but the point was we're not entirely in 
control, so shouldn't over-optimise. I created a worst case scenario, where 
there's one string, preventing the first branch from being removed and then 
only `Byte` and other types which fall through to `OBJECT`. It makes a bit of a 
difference but it's not as bad as the `HashMap`, and is still better than the 
`ClassValue`. The best case scenario is just strings. So even in the worst 
case, this does not regress.
   
   ```
   Benchmark                                      (_scenario)   Mode  Cnt    
Score   Error   Units
   PinotDataTypeMappingBenchmark.singleValueType        worst  thrpt    5  
280.270 ± 1.529  ops/us
   PinotDataTypeMappingBenchmark.singleValueType         best  thrpt    5  
309.094 ± 2.198  ops/us
   ```
   
   (Here are the results with the `HashMap` where performance is better when 
only one key is ever accessed, I didn't bother to test with `ClassValue` since 
I just want to establish that this doesn't regress)
   
   ```
   Benchmark                                      (_scenario)   Mode  Cnt    
Score   Error   Units
   PinotDataTypeMappingBenchmark.singleValueType        worst  thrpt    5  
167.794 ± 1.517  ops/us
   PinotDataTypeMappingBenchmark.singleValueType         best  thrpt    5  
204.106 ± 0.434  ops/us
   ```


-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to