[OpenLayers-Dev] OpenLayers performance
guillaume.sueur at neogeo-online.net
Mon Apr 7 14:40:11 EDT 2008
I wouldn't say OpenLayers performances are slower than GM. You have to
compare things the same way. If your OpenLayers app loads several layers
(say 10), then yes, the pan is becoming slower, a bit like if you were
carrying a heavy weight, which is indeed what you are doing, and what GM
can't do. Furthermore, if your map is very large, say 1680 x 1050, yes
it can be a bit slower too. But most of the time it can be considered at
least as fast as GM (see
http://www.openlayers.org/dev/examples/fullScreen.html for a good example)
But as OpenLayers can do much more than a GoogleMap app, there is
another point to consider which is tuning. When you have many layers,
you have to take care on how each of them is loaded and used in the app,
and set meaningfully options such a SingleTile or the way you access the
data (wms, wms + tilecache, wfs, geoJSON). each of these has its
benefits and drawbacks. But it's not openlayers architecture anymore,
it's your app architecture, your app tuning and settings, and finally,
your job !
And it's an exciting part of it !
Christopher Schmidt a écrit :
> On Mon, Apr 07, 2008 at 05:34:41PM +0200, Tomas Novotny wrote:
>> I'm after few months of using OpenLayers (OL). I've built some
>> application on OL and appreciated it's architecture for good extensibility.
>> But when things come to performance of such common task as panning
>> (moving a map with mouse), I am really dissatisfied.
> Patches welcome.
>> The way the panning is implemented is everything but not
>> browser-friendly. There is coord2pixel and pixel2coord processing on
>> several places in those moveTo() and setCenter() methods on every mouse
>> move and it is only part of the problem. A tried to prune OL for tests
>> to just moving map div with one empty layer and things were still the
>> same. You can feel lags as you are moving map from side to side, up and
>> down. When you try to compare it with ie. GoogleMaps you can really feel
>> the difference.
> I'll state for the record that I don't feel any difference -- if
> anything, I typically feel like GMaps is slower than OpenLayers.
> However, there are a number of patches in trac which have been stated by
> their authors to be 'faster' or 'improve performance', which are
> currently marked for further investigation in OpenLayers 2.7.
>> I haven't seen any OL example with better feeling so I think it's a
>> matter of source architecture, not bug.
> The architecture of OpenLayers is not designed to be slow. If you are
> finding that it is slow, there is no reason that a refactoring of that
> aspect of the code would not be appreciated so long as it did not
> regress in behavior in some important way.
>> What I'm trying to say? I found out that OL are good for building robust
>> applications where wide functionality is the goal, not the performance.
>> If I'm not right and making something wrong please tell me.
> I don't think that OpenLayers tries to be slow in any way. If you feel
> there are obvious deficiencies in the way that OpenLayers does things,
> and see a better way, please feel free to offer them up as comments to
> the community.
More information about the Dev