OpenLayers OpenLayers

Ticket #1364 (new bug)

Opened 7 months ago

Last modified 2 months ago

zoom responce is delayed when you have a lot of OpenLayer.Layers on the map.

Reported by: johnwebbcole Assigned to:
Priority: major Milestone: 2.8 Release
Component: general Version: SVN
Keywords: Cc:
State: Needs Discussion

Description

I have a map with 17 layers (all OpenLayer.Layer.WMS) and since [6200] there is a two second pause when zooming; from the panzoom bar or drag zoom.

As suggested by Christopher on IRC, I've run a Firebug profiler of just the zooming operation (enable profiler, zoom, wait for baselayer (a tilecache wms layer) to respond and turn profiling off).

Here are the top results for [5921]

FunctionCallsPercentOwn TimeTimeAvgMinMaxFile
redraw820.95%62.006ms201.021ms25.128ms18.002ms38.004msLayerSwitcher.js (line 223)
getMousePosition27018.24%54ms65.001ms0.241ms0ms1.001msEvents.js (line 666)
getParameterString2458.45%25.001ms25.001ms0.102ms0ms1.001msUtil.js (line 545)
triggerEvent3708.11%24ms238.022ms0.643ms0ms39.004msEvents.js (line 602)
observe2724.39%13.003ms17.003ms0.063ms0ms1.001msEvents.js (line 165)
draw304.39%13ms57.004ms1.9ms1ms3.001msImage.js (line 129)
selectUrl203.72%11.002ms11.002ms0.55ms0ms1.001msHTTPRequest.js (line 140)
stopObserving2723.72%11ms13ms0.048ms0ms1msEvents.js (line 261)
handleBrowserEvent2702.7%8.001ms101.002ms0.374ms0ms1.001msEvents.js (line 651)
Class4632.7%8.001ms14.002ms0.03ms0ms1.001msClass.js (line 23)
clearLayersArray162.36%7ms22ms1.375ms0ms3msLayerSwitcher.js (line 171)
modifyDOMElement602.03%6.001ms6.001ms0.1ms0ms1.001msUtil.js (line 151)
getElement8172.03%6ms6ms0.007ms0ms1msUtil.js (line 15)
getFullRequestString1182.03%6ms51.005ms0.432ms0ms1.001msHTTPRequest.js (line 168)
getParameters1271.35%4.001ms4.001ms0.032ms0ms1.001msUtil.js (line 816)

and from [6200]

FunctionCallsPercentOwn TimeTimeAvgMinMaxFile
getParameterString523751.41%637ms637ms0.122ms0ms152msUtil.js (line 545)
getFullRequestString261418.08%224ms1059ms0.405ms0ms152msHTTPRequest.js (line 189)
getParameters26237.67%95ms101ms0.039ms0ms1msUtil.js (line 816)
extend52285.33%66ms66ms0.013ms0ms1msUtil.js (line 51)
redraw84.44%55ms1159ms144.875ms106ms261msLayerSwitcher.js (line 229)
upperCaseObject26141.69%21ms21ms0.008ms0ms1msUtil.js (line 487)
getLegendGraphicURLs641.61%20ms1066ms16.656ms11ms164msWMS.js (line 168)
observe2721.45%18ms19ms0.07ms0ms1msEvents.js (line 165)
draw300.97%12ms57ms1.9ms1ms2msImage.js (line 133)
selectUrl200.81%10ms10ms0.5ms0ms1msHTTPRequest.js (line 161)
getMousePosition2290.73%9ms13ms0.057ms0ms3msEvents.js (line 704)
getFullRequestString26140.73%9ms1071ms0.41ms0ms152msWMS.js (line 229)
triggerEvent3500.56%7ms1169ms3.34ms0ms261msEvents.js (line 646)

This is the same application with only a different version of OL.

Attachments

perf.patch (0.8 kB) - added by crschmidt on 03/23/08 07:51:58.

Change History

02/14/08 18:11:56 changed by johnwebbcole

  • type changed from feature to bug.

02/18/08 23:16:17 changed by crschmidt

  • milestone set to 2.6 Release.

02/19/08 00:09:34 changed by crschmidt

I note that getLegendGraphicUrls is now on the list, which it wasn't before. It was called 64 times, and took an extra second of time. I don't know why this was called so much, or what it's doing, or why this is in the list when it wasn't before, but it isn't in trunk OL, and that makes me suspicious.

02/19/08 10:39:42 changed by johnwebbcole

getLegendGraphicUrls is in my sandbox on both versions. I'm using an improved version from [1142] I should have used a clean sandbox of trunk for the profile, but I'm seeing the same problem on my modified or the clean trunk too.

02/28/08 17:49:17 changed by crschmidt

  • state set to Awaiting User Feedback.

Firebug in my browser is apparently not willing to profile at the moment, however, I just did a stopwatch comparison with r6100 and HEAD, and got no measurable difference between the two, with 14 layers added to the lite.html example.

If you can reproduce this, can you attach an example to this page which causes it? The URLs can be bogus, it shouldn't affect things much. If you can attach an example, I'll investigate more.

03/12/08 07:45:28 changed by crschmidt

  • state changed from Awaiting User Feedback to Needs More Work.

Okay, now that I got firebug profiling, I can confirm that things are taking longer. Unfortunately, I can't get it profiling against anything other than a singlefile build, so I can't actually get an accurate picture of what's happening -- so this does need more work, but I can't figure out how i can do it. John, if you could attach a profile against a trunk build without any modifications using your firebug profiling Skillz, please do...

03/23/08 07:51:37 changed by crschmidt

So, I've got profiling working again, and I've actually found that I have no significant difference between r5900 and r6200. However, I do see a significant difference in HEAD: specifically, our forcing of a reflow, added for tile transitions, is very much hurting our performance.

John, this means I'm no longer able to replicate your issue... if I ever could, since I'm pretty sure this is the same thing I was seeinig before.

I suggest that we force a reflow *only* when a transitionEffect is in the list of valid transition effects, and *not* otherwise, since it hurts preformacne a lot (specifically, zooming with 25 layers takes 2x as long: 3.1s to 5.9s).

Hm, I'm just noticing that the way we do our check is with a string indexOf: I think this might also not be the best choice, as this call is happening hundreds of times: it's possible cahing this call would also help.

Attaching a patch that is heading in the right directino: when tile transitions are off, there is no obvious ill visual effect, and the result is that zooming in is ~2x faster.

03/23/08 07:51:58 changed by crschmidt

  • attachment perf.patch added.

03/23/08 07:52:14 changed by crschmidt

  • state changed from Needs More Work to Needs Discussion.

03/26/08 16:21:00 changed by euzuro

  • milestone changed from 2.6 Release to 2.7 Release.

This patch made by cr5 has been moved to a new ticket, #1465. We are moving this ticket to 2.7, when hopefully someone will have time to review it more thoroughly

07/04/08 00:30:04 changed by euzuro

  • milestone changed from 2.7 Release to 2.8 Release.

Mass ticket move out of 2.7 in preparation for a release plan.

If you are actively working on this task, and think that you can help this ticket to get finished and closed by September 1, please move it back to 2.7.