[Mapserver-dev] Re: mapsde.c

Paul Ramsey pramsey at refractions.net
Mon Oct 18 20:03:29 EDT 2004


I have a suspicion that some of the version handling code might be 
making us slower than we need to be.

In particular, here we check for a version, and use SDE.DEFAULT if there 
is not one provided, then we go and do SE_version_get_info() which will 
later provide us with a state_id. But, if our version is SDE.DEFAULT, 
isn't our state_id == SE_DEFAULT_STATE_ID. So we don't need to do the 
version_get_info(), and we also do not need to do the tests for 
SE_stateinfo_is_open(), or the SE_stream_set_state() and all the stuff 
preceding it.

These are questions, not statements, I could be completely wrong in my 
interpretation.

   if (numparams < 3){
     // User didn't specify a version, we'll use SDE.DEFAULT
     if (layer->debug)
       msDebug("msSDELayerOpen(): Layer %s did not have a"
               "specified version.  Using SDE.DEFAULT.\n", layer->name);
       status = SE_version_get_info(sde->connection, "SDE.DEFAULT", 
version);
   }
   else {
     if (layer->debug)
       msDebug("msSDELayerOpen(): Layer %s specified version %s.\n",
               layer->name,
               params[2]);
     status = SE_version_get_info(sde->connection, params[2], version);
   }

Paul

Brock Anderson wrote:

> Now that FastCGI and the SDE connection pooling code seem to work,
> I've had a chance to do some performance tests on the new and
> improved MapServer. Some early results show that Mapserver is about
> 1-2 seconds faster per getMap request than it was with regular CGI,
> but it is still much slower than ArcIMS for simple getMap requests. I
> was testing with a map that had three fairly simple layers; ArcIMS
> returns in ~800ms, MapServer in about 1600ms.
> 
> It looks like msSDELayerOpen() and msSDELayerClose() account for much
> of that difference. I added some debugging statements to the code,
> which revealed:
> 
> In msSDELayerOpen():
> 
> SE_version_get_info() takes 20 - 30ms
> SE_layer_get_info() takes ~100ms
> SE_stream_set_state() takes ~10ms
> 
> the code inside the block:
>   if (!(sde->state_id == SE_DEFAULT_STATE_ID)){
>    ...
>   }
> takes 20 - 100ms
> 
> In msSDELayerClose()
> 
> SE_stream_free() takes 20 - 30ms
> 
> These may seem like minor performance hits, but they occur for each 
> layer, and those numbers become quite significant.  I especially
> worry about the way we handle state ids, and I wonder if we are doing
> it efficiently.  Frank and Howard: do either of you have ideas for
> how mapsde.c could be streamlined? 



More information about the mapserver-dev mailing list