PDA

View Full Version : window.destroy()



extjsperf
27 Jul 2015, 9:37 AM
window.destroy(); is very slow in extjs 4 close to 15 seconds, whereas a similar call in extjs 3 happens in under a second.

Here is a snapshot of the profiler -

I tried suspending events, but its still very slow. Can someone help/point in the right direction?



window.suspendEvents();
window.destroy();
window.resumeEvents(true);






Function
Count
Inclusive Time
Exclusive time


Function.apply
7,149
38,226.38
3


fire
50
38,211.36
2


a.fireEventArgs
369
38,211.36
2


fireEvent
112
38,211.36
1


fireEventArgs
376
38,211.36
1


continueFireEvent
48
38,211.36
0


m
340
37,911.97
2


Function.call
847
37,881.07
1


Function code
62
37,878.09
0


handleEvent
4
37,859.08
0


processUIEvent
4
37,859.08
0


callParent
4,662
36,679.85
25.01


processItemEvent
4
36,639.21
0


Anonymous function
15
36,638.21
1


addStuff
1
36,637.21
0


selectOptions
1
36,637.21
0


destroy
64
34,525.57
1


beforeDestroy
1
34,524.57
0


beforeDestroy
9
30,105.43
0


beforeDestroy
9
30,105.43
0


beforeDestroy
30
30,103.43
0


doRemove
57
30,101.42
1


beforeDestroy
1
30,040.38
0


Anonymous function
196
30,035.38
1


remove
161
30,030.37
1


removeChild
196
30,026.37
30,009.36


onHide
1
4,419.14
0


hide
1
4,419.14
0


onHide
1
4,419.14
0


afterHide
1
4,413.14
1


b.afterHide
1
4,413.14
0


afterHide
1
4,413.14
0


afterHide
1
4,413.14
0


blur
1
4,412.14
4,412.14


blur
1
4,412.14
0


set
16
2,464.92
1


callStore
12
2,463.92
1


afterEdit
12
2,463.92
0


onUpdate
12
2,462.92
1


afterEdit
12
2,462.92
0


refreshSize
12
2,234.35
0


run
12
2,229.34
0.98


statics.resumeLayouts
60
2,229.34
0


Ext.resumeLayouts
16
2,229.34
0


statics.flushLayouts
31
2,125.27
0


runCycle
84
2,080.25
1


runLayout
684
2,079.25
2


calculate
540
2,027.22
1


measureAutoDimensions
564
2,009.19
2


calculate
72
2,004.21
0


getWidth
86
1,993.18
0


offsetWidth
87
1,990.18
1,990.18


measureContentWidth
7
1,933.38
0


selectWithEvent
1
1,209.86
0


onRowMouseDown
1
1,209.86
0


processSelection
1
1,209.86
0


doSelect
1
1,208.86
0


doSingleSelect
1
1,208.86
0


setLastFocused
2
1,200.85
0


onLastFocusChanged
1
1,200.85
0


onRowFocus
1
1,199.85
0


focusRow
1
1,191.85
0


getBoundingClientRect
5
1,112.79
1,112.79


inheritableStatics.getXY
5
1,112.79
0


getXY
5
1,112.79
0


scrollIntoView
1
1,112.79
0


getOffsetsTo
1
1,112.79
0


scrollRowIntoView
1
1,112.79
0

scottmartin
28 Jul 2015, 6:36 AM
You must have something else going on in the background, as a simply window.destroy should not behave that way.

Perhaps a small test case?
https://fiddle.sencha.com/#home

extjsperf
28 Jul 2015, 6:59 AM
Thanks for the reply Scott. The code is too complex to replicate into a test case. We are launching a window from on click on a button in a panel. There are some nested components in the window. I know this might not be enough information for you, but based on the profiler data and code below could be please nudge me in the right direction?

We have a similar piece of code doing exactly same thing in another window in the application which was written in extjs 3 and we don not see issues there.

Here is the piece of code that does the destroy



if(_landingPage == 'xyz'){ _selectedItem = "";
_selectedItem = item;
_window.suspendEvents();
_window.close();
_window.resumeEvents(true);
currentRecord.set('item',_selectedItem);
validateItem(currentRowIndex); //ajax call - this is quite fast under 0.5 secs
return;
}

scottmartin
28 Jul 2015, 7:10 AM
Ah, The ole shots in the dark approach ...

Do you have any layout changes happening? Perhaps Ext.suspendLayouts() around the code block?

extjsperf
28 Jul 2015, 11:00 AM
Thanks Scott, I tried that, still the same results and almost similar profiler data.

Code snippet below -



if(_landingPage == 'xyz'){ _selectedItem = "";
_selectedItem = item;
Ext.suspendLayouts();
_window.suspendEvents();
_window.close();
_window.resumeEvents(true);
currentRecord.set('item',_selectedItem);
validateItem(currentRowIndex); //ajax call - this is quite fast under 0.5 secs
Ext.resumeLayouts(true);
return;
}

scottmartin
28 Jul 2015, 11:09 AM
Not sure what information I can provide without any details. You can step through the code and start to narrow it down.
If you remove items from the window, does it behave any better. Then start drilling down from there.

extjsperf
28 Jul 2015, 11:19 AM
Ok Scott. This is happening only in IE9, IE11 browsers. Firefox & Chrome it works just fine. Do you think we need anything done for IE specifically?