logo separator

[mkgmap-dev] Move to Java 1.8

From Gerd Petermann GPetermann_muenchen at hotmail.com on Thu Aug 18 07:07:38 BST 2016

Hi Uli,


sorry for the delay. In the meantime I coded some patches for JOSM.

I do not yet see the advantage of using the .stream() method, maybe because I am not used

to lambda expressions. Why do you favor them in the code snippets touched by the patch?


Gerd

________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von UliBaer <ulibaer at gmail.com>
Gesendet: Dienstag, 2. August 2016 18:11:34
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Move to Java 1.8

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.
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20160818/ed7dcc87/attachment.html>


More information about the mkgmap-dev mailing list