Closed Bug 379248 Opened 18 years ago Closed 8 years ago

Recursion check seems to be slower with getElementsByName use

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: martijn.martijn, Unassigned)

References

()

Details

(Keywords: perf, regression, testcase)

Attachments

(1 file)

Attached file testcase
This came from Hendrix feedback: http://groups.google.com/group/mozilla.feedback/browse_thread/thread/71383d0da773dd69/a749e0d4099647ce#a749e0d4099647ce That page hangs for a while at the end of page load. It happens because of a (bogus) function that recursively calls itself (getMeta) (even multiple times). But in Mozilla1.7, the "too much recursion" check seems to happen very much quicker than in current builds, so the hang doesn't happen nearly as long in older builds. See the zipped testcase. When clicking on the "getElementsByName recursive" button, the browser hangs for a little while before the error gets thrown. When clicking on the "getElementsByTagName recursive" button, the browser seems to throw much quicker. This regressed between 2005-10-03 and 2005-10-04: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-10-03+04&maxdate=2005-10-04+09&cvsroot=%2Fcvsroot It seems to me this is a regression from bug 310351, somehow. Not really related to this bug: I also added 2 buttons that test getElementsByName and getElementsByTagName performance. Results in various builds: 2005-10-03 2656ms 718ms 2005-10-04 2937ms 656ms 2007-04-29 3531ms 875ms 2007-01-02 3188ms 890ms 2006-10-01 3312ms 922ms
Perhaps this is a result of bug 335058?
Assignee: general → nobody
QA Contact: ian → general
Against Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/16.0 Firefox/16.0a1 ID:20120617030532 I get 11ms for the getElementsByName/getElementsByTagName Cases and "Error: too much recursion" Errors in Error Console for the other two Cases.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Just retested with the testcase modified to log how long it takes to hit the infinite recursion exception, and now getElementsByName is identical to getElementsByTagName.
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: