[PATCH v2] Major speedup for mp code

Attached patch can be summarized very easy: * Major speedup for mp code Please test and commit if no problems arise. WanMil

Hi WanMil, On Fri, Jan 22, 2010 at 12:19:31AM +0100, WanMil wrote:
Attached patch can be summarized very easy:
* Major speedup for mp code
Please test and commit if no problems arise.
Sorry for nitpicking, but could you please fix a few formatting issues and comments in the patch? Some changes look like they could be accidental, such as this one:
- // mark this ways as artificially closed + // mark this ways as artifically closed way.closeWayArtificial();
The correct spelling is "artificially".
@@ -357,8 +359,9 @@ JoinedWay tempWay = it.next(); if (tempWay.isClosed() == false) { if (first) { - log.warn( - "Cannot join the following ways to closed polygons. MP-Relation", + log + .warn( + "Cannot join the following ways to closed polygons. MP-Relation", toBrowseURL()); } logWayURLs(Level.WARNING, "- way:", tempWay); @@ -810,7 +813,9 @@ */ private Way singularAreaToWay(Area area, long wayId) { if (area.isSingular() == false) { - log.warn("singularAreaToWay called with non singular area. Multipolygon ", + log + .warn( + "singularAreaToWay called with non singular area. Multipolygon ", toBrowseURL()); } if (area.isEmpty()) {
These apparently are white-space changes that make the code uglier to my eye. (It is a matter of taste, of course.)
@@ -994,7 +992,7 @@ * * @param ring1 * a closed way - * @param ring2 A second closed way. + * @param ring2 * @return true if ring1 contains ring2 */ private boolean contains(JoinedWay ring1, JoinedWay ring2) {
You are removing the parameter description of ring2.
@@ -1079,19 +1135,80 @@ */ private static class JoinedWay extends Way { private final List<Way> originalWays; - private boolean closedArtifical; + private boolean closedArtifical = false; + + public int minLat; + public int maxLat; + public int minLon; + public int maxLon; + private Rectangle bounds = null;
It would be nice to have some comments for all members and methods of JoinedWay. (OK, it is a work in progress.)
@@ -1180,4 +1298,5 @@ this.ring = ring; } } + }
It is a matter of taste, but I would not like empty lines between closing braces. (I will leave it up to Mark or Steve to commit the patch. I know too little about the multipolygon code, and I haven't tested generate-sea after the mp merge.) Best regards, Marko

Attached patch has better formatting and some other 'nitpicked' (Marko you are totally right!) improvements. WanMil

On 22.01.2010 09:28, WanMil wrote:
Attached patch has better formatting and some other 'nitpicked' (Marko you are totally right!) improvements.
WanMil
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev Made it even faster for the most difficult country (Norway) - smaller but significant change on landlocked countries. (in general "fixing" the "continue" command in 1498 brought about 100% longer compile time) 1505 start compilation 2:15:35 norway end compilation 2:18:08 norway
start compilation 4:00:43 austria end compilation 4:05:46 austria *1505 with patch*: start compilation 11:17:20 norway end compilation 11:19:23 norway start compilation 11:28:44 austria end compilation 11:33:11 austria
participants (3)
-
Felix Hartmann
-
Marko Mäkelä
-
WanMil