Closed Bug 10313 Opened 21 years ago Closed 21 years ago

Dynamically adjusting the clip: property gives uneven results

Categories

(Core :: Layout, defect, P3, critical)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: shashi, Assigned: vidur)

References

()

Details

(Whiteboard: [Perf][TESTCASE] shashi@narain.com)

For the test2.html file...after the icons move into place, the page does a
pseudo-transition by dynamically adjusting the clip: property via JS. As you can
see the speed of the transition is very slow and doesn't do it very smoothly
(rather jerky). If you have a CPU monitor handy, you will see 100% CPU usage
(very large for something so simple...I use a PIII-450).

For the test3.html file...with this page I have removed the JS sequence for
moving the icons into place. The only JS involved is to do the
pseudo-transition. Here the transition is performing as designed (fast and
smooth) with very little CPU usage.
Whiteboard: [TESTCASE] shashi@narain.com
Assignee: troy → vidur
Vidur, the performance problem seems proportional to the number of operations.
It starts out fine and then gets slower and slower and slower

In looking at it I don't think it's layout that is slow because the elements
are all absolutely positioned and so we don't do that much work
I don't know if this is causing memory leaks (and hence the slow down), but when
running Purify on a different page that uses JavaScript, I see a lot of FMM
(free memory mismatch) complaints from Purify:

[E] FMM: Freeing mismatched memory in delete(void *) {9 occurrences}
    Address 0x038e7628 points into a HeapAlloc'd block in heap 0x032c0000
    Location of free attempt
        delete(void *) [dbgdel.cpp:35]
        nsScriptNameSpaceManager::LookupName(nsString const&,int,nsID&)
[nsScriptNameSpaceManager.cpp:116]
                  if (nsnull != mGlobalNames) {
                    char* name = aName.ToNewCString();
                    nsGlobalNameStruct* gn =
(nsGlobalNameStruct*)PL_HashTableLookup(mGlobalNames, name);
             =>     delete [] name;

                    if ((nsnull != gn) && (gn->mIsConstructor ==
aIsConstructor)) {
                      aCID = gn->mCID;
        nsJSUtils::nsGlobalResolve(JSContext *,JSObject *,long)
[nsJSUtils.cpp:389]
        ResolveWindow  [nsJSWindow.cpp:927]
        js_LookupProperty [jsobj.c:1507]
        js_FindProperty [jsobj.c:1569]
        js_FindVariable [jsobj.c:1603]
        js_Interpret   [jsinterp.c:1549]
        js_Invoke      [jsinterp.c:670]
        js_Interpret   [jsinterp.c:2228]
        js_Invoke      [jsinterp.c:670]
        js_Interpret   [jsinterp.c:2228]
        js_Invoke      [jsinterp.c:670]
        js_InternalCall [jsinterp.c:747]
        JS_CallFunctionValue [jsapi.c:2643]
        nsJSEventListener::HandleEvent(nsIDOMEvent *) [nsJSEventListener.cpp:97]
        nsEventListenerManager::HandleEvent(nsIPresContext&,nsEvent
*,nsIDOMEvent * *,UINT,nsEventStatus&) [nsEventListenerManager.cpp:587]
        nsGenericElement::HandleDOMEvent(nsIPresContext&,nsEvent *,nsIDOMEvent *
*,UINT,nsEventStatus&) [nsGenericElement.cpp:779]
        nsHTMLTableCellElement::HandleDOMEvent(nsIPresContext&,nsEvent
*,nsIDOMEvent * *,UINT,nsEventStatus&) [nsHTMLTableCellElement.cpp:540]
        nsGenericDOMDataNode::HandleDOMEvent(nsIPresContext&,nsEvent
*,nsIDOMEvent * *,UINT,nsEventStatus&) [nsGenericDOMDataNode.cpp:717]
        nsTextNode::HandleDOMEvent(nsIPresContext&,nsEvent *,nsIDOMEvent *
*,UINT,nsEventStatus&) [nsTextNode.cpp:188]

nsEventStateManager::CheckForAndDispatchClick(nsIPresContext&,nsMouseEvent
*,nsEventStatus&) [nsEventStateManager.cpp:668]
        nsEventStateManager::PostHandleEvent(nsIPresContext&,nsGUIEvent
*,nsIFrame *,nsEventStatus&,nsIView *) [nsEventStateManager.cpp:194]
        PresShell::HandleEvent(nsIView *,nsGUIEvent *,nsEventStatus&)
[nsPresShell.cpp:2247]
        nsView::HandleEvent(nsGUIEvent *,UINT,nsEventStatus&,int&)
[nsView.cpp:833]
    Allocation location
        No call stack recorded

And this one. There are too many to list them all:

[E] FMM: Freeing mismatched memory in delete(void *) {1 occurrence}
    Address 0x03ae7568 points into a HeapAlloc'd block in heap 0x032c0000
    Location of free attempt
        delete(void *) [dbgdel.cpp:35]
        nsDOMScriptObjectFactory::NewScriptElement(nsString
const&,nsIScriptContext *,nsISupports *,nsISupports *,void * *)
[nsDOMFactory.cpp:374]
                  nsDOMHTMLTag tag = NS_DOMTagToEnum(str);

                  if (str) {
             =>     delete[] str;
                  }

                  switch (tag) {
        nsGenericElement::GetScriptObject(nsIScriptContext *,void * *)
[nsGenericElement.cpp:932]
        nsHTMLTableRowElement::GetScriptObject(nsIScriptContext *,void * *)
[nsHTMLTableRowElement.cpp:89]
        nsJSUtils::nsConvertObjectToJSVal(nsISupports *,JSContext *,long *)
[nsJSUtils.cpp:136]
        HTMLTableSectionElementInsertRow [nsJSHTMLTableSectionElement.cpp:336]
        js_Invoke      [jsinterp.c:654]
        js_Interpret   [jsinterp.c:2228]
        js_Invoke      [jsinterp.c:670]
        js_Interpret   [jsinterp.c:2228]
        js_Invoke      [jsinterp.c:670]
        js_Interpret   [jsinterp.c:2228]
        js_Invoke      [jsinterp.c:670]
        js_InternalCall [jsinterp.c:747]
        JS_CallFunctionValue [jsapi.c:2643]
        nsJSEventListener::HandleEvent(nsIDOMEvent *) [nsJSEventListener.cpp:97]
        nsEventListenerManager::HandleEvent(nsIPresContext&,nsEvent
*,nsIDOMEvent * *,UINT,nsEventStatus&) [nsEventListenerManager.cpp:587]
        nsGenericElement::HandleDOMEvent(nsIPresContext&,nsEvent *,nsIDOMEvent *
*,UINT,nsEventStatus&) [nsGenericElement.cpp:779]
        nsHTMLTableCellElement::HandleDOMEvent(nsIPresContext&,nsEvent
*,nsIDOMEvent * *,UINT,nsEventStatus&) [nsHTMLTableCellElement.cpp:540]
        nsGenericDOMDataNode::HandleDOMEvent(nsIPresContext&,nsEvent
*,nsIDOMEvent * *,UINT,nsEventStatus&) [nsGenericDOMDataNode.cpp:717]
        nsTextNode::HandleDOMEvent(nsIPresContext&,nsEvent *,nsIDOMEvent *
*,UINT,nsEventStatus&) [nsTextNode.cpp:188]

nsEventStateManager::CheckForAndDispatchClick(nsIPresContext&,nsMouseEvent
*,nsEventStatus&) [nsEventStateManager.cpp:668]
        nsEventStateManager::PostHandleEvent(nsIPresContext&,nsGUIEvent
*,nsIFrame *,nsEventStatus&,nsIView *) [nsEventStateManager.cpp:194]
        PresShell::HandleEvent(nsIView *,nsGUIEvent *,nsEventStatus&)
[nsPresShell.cpp:2247]
        nsView::HandleEvent(nsGUIEvent *,UINT,nsEventStatus&,int&)
[nsView.cpp:833]
    Allocation location
        No call stack recorded
Whiteboard: [TESTCASE] shashi@narain.com → [Perf][TESTCASE] shashi@narain.com
Putting on [Perf] radar.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Again, the problem is in the test case. There is a missing "else" before the
second "if" clause in the function MoveGeckoIcon() and others. As a result, the
number of timeouts increases exponentially with each new function.
Status: RESOLVED → VERIFIED
Based on Vidar's comments, marking as verified invalid.
*** Bug 11421 has been marked as a duplicate of this bug. ***
Since this bug is fixed, I am removing the testcase from my server.
You need to log in before you can comment on or make changes to this bug.