mdedetrich commented on PR #371:
URL: https://github.com/apache/incubator-pekko/pull/371#issuecomment-1592141625

   So as @pjfanning pointed out, the current benchmarks are somewhat misleading 
in that they are run over 8 threads which is the complete worst case scenario 
for `synchronized` especially when taking into account that in almost every 
case the calls will from the same thread, only when `recoverWith` in the 
`Future` block gets hit can we get multiple calls.
   
   If we modify benchmark to just use single thread then here is the non 
`synchronized` version
   
   ```
   [info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  0,441 ±  
0,031  ops/ns
   [info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3  0,001 ±  
0,001  ops/ns
   [info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3  0,313 ±  
0,034  ops/ns
   ```
   
   and synchronized version
   
   ```
   [info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  0,380 ±  
0,008  ops/ns
   [info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3  0,001 ±  
0,001  ops/ns
   [info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3  0,312 ±  
0,053  ops/ns
   ```


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to