[OpenLayers-Dev] javascript workers

Christopher Schmidt crschmidt at metacarta.com
Tue Jun 23 13:09:43 EDT 2009


On Tue, Jun 23, 2009 at 05:44:57PM +0200, rldhont wrote:
> Christopher Schmidt a écrit :
> >On Tue, Jun 23, 2009 at 10:13:40AM +0200, Esteban olm wrote:
> >  
> >>Hello,
> >>
> >>Is in the openlayers developers' mind the idea of use javscript workers in
> >>browsers that will support them to improve performance?
> >>
> >>I think, for example, to have two "sub-layers" for each layer, so the
> >>workers draws the new data on the hidden sublayer, then when finished, it
> >>calls the main thread and it hides the actual sublayer and shows the 
> >>hidden
> >>one, or something like that.
> >>
> >>For the user, there is no IU lost of performance, and he see the layer
> >>re-drawn only when it has been finished.
> >>Or something like that :)
> >>    
> >
> >As far as I know, no browser (apart from Chrome?) natively supports
> >Javascript workers. The idea of maintaining something that is in such a
> >small percentage of browsers in the core of OpenLayers worries me, but
> >would be happy to suppot it as an addin, maintained by the community.
> >
> >Regards,
> >  
> 
> Firefox 3.5, which is in a public Realese Candidate Version, natively 
> supports JavaScript Workers. And it's probably the same implementation 
> in google gears like for Geolocation API.
> 
> JavaScript Workers will be usefull for reprojection, writing format, 
> intersection and other geo-treatment, but it's not possible to use DOM 
> in Worker.

In that case, it seems unlikely the benefit would be signnificant.
Reprojection, writing formats, and (most) intersection work is fast
enough that I can't see the overhead being worth it. We can reproject
thousands of points a minute, and most of our formats center around the
usage of an XML DOM (don't know if this applies to the 'dom' restriction
or not). I'd suggest finding something that you think is slow and 
profiling it before deciding that workers will actually be worth the
effort :)

-- Chris

> Regards,
> 
> René-Luc D'Hont
> 3Liz

-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list