Parallelizing calls to msDrawLayer()

Tamas Szekeres szekerest at GMAIL.COM
Sun Oct 14 04:20:05 EDT 2007

2007/10/14, David Fuhry <dfuhry at>:

> Ah ok, glancing at maplayer.c and mapdraw.c, I'm starting to see what
> you mean.  So msDrawVectorLayer currently loops like:
> while (s = layer->vtable->NextShape())
> {
>     msDrawShape(s);
> }
> and your thought is to... buffer the shapes (some of them, or all of
> them) with asynchronous NextShape calls, then render the buffer?  I
> think I fail to grasp the full picture, because what will be going on
> while NextShape() asynchronously fetches the next shape(s)?  The answer
> can't be "nothing", or we fail to exploit parallelism.
> Or are you suggesting we fetch the /first/ shape of every layer in
> parallel, so as to get the rest of the shapes queued up behind the first
> one (depending on the driver, sort of)?

It somewhat depends on the driver which startegy would bring the best
performance.  We should indeed gather some statistics related to the
drivers to make further decisions.

> Steve W. had valid concerns that overzealous buffering would use
> excessive memory.  I see now that msDrawVectorLayer() uses a pipelined
> approach which keeps minimal geometry (a single shape) around at once,
> leaving buffering decisions to the driver.  I like it.

I think it would be better to allow the decision to the
user/administrator how the performance/memory requirement should be
optimized. Mapserver should allow be parametrized for either the low
or the high memory consumption profile.

Best regards,


More information about the mapserver-dev mailing list