[Mapserver-dev] Speed Improvement Fix.

Alan Steremberg alans at wunderground.com
Wed Nov 5 22:31:20 EST 2003


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 insertion
which is time n.  It is possible that the lines will now draw backwards
(not sure if this is a problem) if it is, we should change the linked list
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

More information about the mapserver-dev mailing list