logo separator

[mkgmap-dev] Move to Java 1.8

From UliBaer ulibaer at gmail.com on Tue Aug 2 17:11:34 BST 2016

Gerd Petermann wrote
> Hi Uli,
> 
> thanks for the patch. I tried it and found no significant change in run
> time
> or memory usage.
> My test case: Compile 9 tiles (a part of the Britisch Isles) (with
> --max-jobs on 4 cores)
> In what scenario do you think that the stream methods should save time?
> 
> My understanding is that the list streaming is better as it allows
> automatic
> use of multiple cores, so I'd expect improvements in e.g. the gmapsupp
> builder
> which uses a single thread, but not in the code which compiles the tiles.
> On the other hand, the combiners which run single threaded are probably
> more I/O bound.
> 
> Gerd

Hi Gerd,

the patch only used the sequential .stream(). method. If you want to use
multiple cores, simply replace the .stream(). with .parallelStream(). and
the jvm tries to work parallel pipelines with multiple threads. You only
have to be aware, that the order of processing is completely arbitrary in
that case, so the atomic operations have to be independent of each other and
not depend on the order of execution. Also the order of elements in the
resulting list is arbitrary. This can be worked around by using a SortedList
for the collection or by using .sorted((o1, o2) ->
o1.getField().compareTo(o2.getField())). near the end of the streaming
pipeline.

Best regards, Uli



--
View this message in context: http://gis.19327.n5.nabble.com/Move-to-Java-1-8-tp5879546p5879702.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.


More information about the mkgmap-dev mailing list