Reputation: 21
Looking for new hardware, I read that "The key improvement to the i7-8750H is in its core count: we’re now looking at 6 cores and 12 threads".
1/ Would Runtime.getRuntime().availableProcessors() return 6 or 12?
2/ In this case, is using a 12 threads parallelism a better idea than using a 6 threads parallelism for a simple task of parallelized calculation?
Thanks
Upvotes: 2
Views: 2338
Reputation: 73528
Runtime.getRuntime().availableProcessors()
would return 12
as the amount of available processors for Java. Java doesn't know that there's only 6 physical cores, and it doesn't really care either (Java does do some tricks that depend on the amount of processors, but that's usually single-CPU vs. multicore).
The best way to know if your code will benefit from increasing parallelism is by testing it. You certainly can't calculate any performance improvements based on just the amount of cores.
Upvotes: 3