Når din app er singlethreaded så er det klart at den ikke kan
performe bedre. Men den burde jo sådan set heller
ikke performe dårligere.
Men der er en interessant artikel her:
http://www.sys-con.com/java/article.cfm?id=2163Specielt i kommentarerne til sidst hvor der bl.a står følgende
(kun uddrag - læs selv det hele):
I've been working on my own benchmark for Java and C# for few months. The first version was for Java only. When I developed the second (portable) version for Java and C#, then ran it on W2k and Linux, I found the strange thing: Java was twice slower than C# in one of the tests. It took me a while to realize that the problem was with HT. I had HT switched on on my Xeon-powered server. My benchmark is SINGLE-threaded.
True, HT is not always good. Given the nature of SMT, it is anticipated that compute intensive single threaded applications will see some potential performance degredation. A 2x change seems suspect however -- where all other test parameters invariant?
My guess is that the OS was scheduling the idle task on the 2nd logical CPU blowing the L1 cache out from under the benchmark running on the other logical processor. And the benchmark was compact and fit completely within L1 cache. The difference in speed between L1 --> L2 --> (possible L3) --> main memory is easily a factor of 2 or more.