Big speed difference for G1 vs. parallel GC

Peter graphhopper at gmx.de
Mon Oct 31 20:47:35 UTC 2016


Hi Bernd,

why do you think it is measuring a short workload? 'short' in which
terms? The overall test suite takes roughly 3 minutes but can be
increased easily via increasing the number of road routing queries. BTW:
with routing.mean we measure the latency of every road routing query, at
least I think so ;)

> Did you check the verbose GC logs, and how many CPUs does Java see/use?

Nothing suspicious in the GC logs
<https://gist.github.com/karussell/94848aa48244252c6010018b3621b565>
IMO, except that G1 produces much more output. Still this reminded me of
another mistake <http://stackoverflow.com/q/38905739/194609> I made
recently (not disabling swapping) and so I went to my dev server
(instead of laptop) where this is already done and have more RAM there
(32g), still using just 1000m and the results are a bit better: 320ms
vs. only 235ms, so G1 is only ~25% slower. What differences are expected
here ... let's say 'maximum'?

BTW: CPU usage on the server is roughly 200-240% for G1 and 100-120% for
the parallel GC, so the speedup might be also related to the CPUs as the
laptop only has 2 cores without hyperthreading.

Regards
Peter

On 31.10.2016 20:52, Bernd Eckenfels wrote:
> Hello,
>
> Since this is measuring a short workload after vom startup it might
> not be the best benchmark, but then again throughput GC is expected to
> be faster than G1.
>
> In the particular case however I guess you could tune G1 a bit to that
> workload. Did you check the verbose GC logs, and how many CPUs does
> Java see/use?
>
> Gruss
> Bernd
> -- 
> http://bernd.eckenfels.net
>
>
>
>
> On Mon, Oct 31, 2016 at 8:38 PM +0100, "Peter" <graphhopper at gmx.de
> <mailto:graphhopper at gmx.de>> wrote:
>
>     Hi,
>
>     I've stumbled today* over a big speed difference for code
>     execution with G1 GC vs. parallel GC also in the latest JDK8
>     (1.8.0_111-b14). Maybe you have interests to investigate this. You
>     should be able to reproduce this via:
>
>     # setup
>     git clone https://github.com/graphhopper/graphhopper
>     wget http://download.geofabrik.de/europe/germany/bayern-latest.osm.pbf
>     cd graphhopper
>
>     # run measurement
>     export JAVA_OPTS="-XX:+UseParallelGC -Xmx1000m -Xms1000m"
>     # the graphhopper.sh script just makes the installation of maven
>     and bundling the jar a bit simpler
>     # you can also execute the tests in the class Measurement.java
>     <https://github.com/graphhopper/graphhopper/blob/master/tools/src/main/java/com/graphhopper/tools/Measurement.java>
>     ./graphhopper.sh clean
>     ./graphhopper.sh measurement berlin-latest.osm.pbf
>     # now a measurement-<some date>.properties is created:
>     grep routing.mean measurement-XY.properties
>
>     Now this should print a line where the value is in ms. E.g. I get
>     ~450ms for the parallel GC and ~780ms for G1GC (on an old laptop).
>     When I increase the Xmx for the G1 run to 1400m the results do NOT
>     get closer to parallel GC!
>
>     Let me know if you need more information!
>
>     Regards
>     Peter
>
>     *
>     https://github.com/graphhopper/graphhopper/issues/854
>
>     -- 
>     GraphHopper.com - fast and flexible route planning
>


-- 
GraphHopper.com - fast and flexible route planning

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20161031/dbad6849/attachment.html>


More information about the hotspot-gc-use mailing list