fabienrenaud / java-json-benchmark

Performance testing of serialization and deserialization of Java JSON libraries
MIT License
965 stars 134 forks source link

Set default number of threads based on number of cores #95

Closed sebthom closed 6 months ago

sebthom commented 6 months ago

Using more threads than cores results in unnecessary context switches and will actually decrease throughput. I set the number of threads to the number cores minus 1 so the OS has one core to do other pressing things and does not need to congest the cores utilized by JMH.

fabienrenaud commented 6 months ago

Thanks!