Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is the 64bit JVM faster than the 32bit one?
    primarykey
    data
    text
    <p>Recently I've been doing some benchmarking of the write performance of my company's database product, and I've found that simply switching to a 64bit JVM gives a consistent 20-30% performance increase.</p> <p>I'm not allowed to go into much detail about our product, but basically it's a column-oriented DB, optimised for storing logs. The benchmark involves feeding it a few gigabytes of raw logs and timing how long it takes to analyse them and store them as structured data in the DB. The processing is very heavy on both CPU and I/O, although it's hard to say in what ratio.</p> <p>A few notes about the setup:</p> <pre><code>Processor: Xeon E5640 2.66GHz (4 core) x 2 RAM: 24GB Disk: 7200rpm, no RAID OS: RHEL 6 64bit Filesystem: Ext4 JVMs: 1.6.0_21 (32bit), 1.6.0_23 (64bit) Max heap size (-Xmx): 512 MB (for both 32bit and 64bit JVMs) </code></pre> <p>Constants for both JVMs:</p> <ul> <li>Same OS (64bit RHEL)</li> <li>Same hardware (64bit CPU)</li> <li>Max heap size fixed to 512 MB (so the speed increase is not due to the 64bit JVM using a larger heap)</li> </ul> <p>For simplicity I've turned off all multithreading options in our product, so pretty much all processing is happening in a single-threaded manner. (When I turned on multi-threading, of course the system got faster, but the ratio between 32bit and 64bit performance stayed about the same.)</p> <p>So, my question is... Why would I see a 20-30% speed improvement when using a 64bit JVM? Has anybody seen similar results before?</p> <p>My intuition up until now has been as follows:</p> <ul> <li><p>64bit pointers are bigger, so the L1 and L2 caches overflow more easily, so performance on the 64bit JVM is worse.</p></li> <li><p>The JVM uses some fancy pointer compression tricks to alleviate the above problem as much as possible. Details on the Sun site <a href="http://wikis.sun.com/display/HotSpotInternals/CompressedOops" rel="noreferrer">here</a>.</p></li> <li><p>The JVM is allowed to use more registers when running in 64bit mode, which speeds things up slightly.</p></li> </ul> <p>Given the above three points, I would expect 64bit performance to be slightly slower, or approximately equal to, the 32bit JVM.</p> <p>Any ideas? Thanks in advance.</p> <p><strong>Edit:</strong> Clarified some points about the benchmark environment.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload