[Mapserver-dev] Speed Improvement Fix.

Steve Lime steve.lime at dnr.state.mn.us
Thu Nov 6 14:07:02 EST 2003

Excellent- we like speed increases. Actually someone suggested a similar
modification a long time ago but I lost the email and code change and it
never got put in place. I'll make sure this time the code is commited to
the 4.1 source tree! I don't think the order is relevant, but I'll have
to think about it since this is used not just with inline features. Do
you know/have the mod needed to keep things in order?


>>> Alan Steremberg <alans at wunderground.com> 11/5/2003 9:31:20 PM >>>


I am not sure if this changes the drawing behaviour, but I was able to
speed up one of the layers I was drawing by a factor of 4-6.

Here is the issue:
  When drawing Overlay symbols, mapdraw caches everything using
'insertFeatureList'.  insertFeaturelist is a linked list with a tail
insertion. This is n*log(n).  I switched the algorithm to a head
which is time n.  It is possible that the lines will now draw
(not sure if this is a problem) if it is, we should change the linked
structure to have a last pointer that we can keep updated.

here is my modification:


/* AJS -- link the list the other way?? */
/* BEFORE --> */
#if 0
  node->next = NULL;

  previous = NULL;
  current = *list;
  while(current != NULL) {
    previous = current;
    current = current->next;

  if(previous == NULL) {
    *list = node;
  } else
    previous->next = node;
/* AJS */
/* AFTER, two lines of code */



 Alan Steremberg
 415-543-5021 x 103
Mapserver-dev mailing list
Mapserver-dev at lists.gis.umn.edu 

More information about the mapserver-dev mailing list