Changeset 12009 in josm


Ignore:
Timestamp:
2017-04-27T19:59:48+02:00 (2 years ago)
Author:
michael2402
Message:

See #13883: Use parallel sort for style elems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r11914 r12009  
    2727import java.awt.image.BufferedImage;
    2828import java.util.ArrayList;
     29import java.util.Arrays;
    2930import java.util.Collection;
    30 import java.util.Collections;
    3131import java.util.HashMap;
    3232import java.util.Iterator;
     
    15231523            }
    15241524
    1525             Collections.sort(allStyleElems); // TODO: try parallel sort when switching to Java 8
     1525            // We use parallel sort here. This is only available for arrays.
     1526            StyleRecord[] sorted = allStyleElems.toArray(new StyleRecord[allStyleElems.size()]);
     1527            Arrays.parallelSort(sorted, null);
    15261528
    15271529            if (!benchmark.renderDraw(allStyleElems)) {
     
    15291531            }
    15301532
    1531             for (StyleRecord record : allStyleElems) {
     1533            for (StyleRecord record : sorted) {
    15321534                paintRecord(record);
    15331535            }
Note: See TracChangeset for help on using the changeset viewer.