Poor performance where accessing form elements

VERIFIED DUPLICATE of bug 25353

Status

()

P3
normal
VERIFIED DUPLICATE of bug 25353
19 years ago
19 years ago

People

(Reporter: jiri.amler, Assigned: vidur)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [HAVE FIX], URL)

Attachments

(2 attachments)

(Reporter)

Description

19 years ago
M14 Build

<form>
<input type="checkbox" name="s" value="0">
<input type="checkbox" name="s" value="1">
......
<input type="checkbox" name="s" value="499">
</form>
<script>
var el= document.forms[0];
var clen= el.length;

start= new Date;

for(var f=0; f<clen; f++) {
	el[f].type;
	el[f].name;
};

alert((new Date) - start);
</script>

The following code completes in:

IE5:     170 ms

NN3:     50 ms
NN4:     270 ms
Mozilla: 13000 ms

(Pentium 200MHZ)
This is fixed, I'll attach the patch and I'll try to check in the fix once the
tree opens for normal checkins...

The problem was basically that el[<nr>] in the testcase caused mozilla to search
the document for an element with the name (or id) ("1", "2", "3"...) in stead of
directly accessing the n'th input in the form.

With the patch the iteration takes 120ms (400MHz PII).
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Windows 98 → All
Hardware: Other → All
Target Milestone: M15
Created attachment 6054 [details] [diff] [review]
Patch that fixes the problem...
Created attachment 6060 [details] [diff] [review]
New patch (thanks to vidurs feedback!)

Updated

19 years ago
Summary: Poor performance where accessing form elements → [HAVE FIX] Poor performance where accessing form elements

Updated

19 years ago
Summary: [HAVE FIX] Poor performance where accessing form elements → Poor performance where accessing form elements
Whiteboard: [HAVE FIX]
This fix was checked in by joki (nsHTMLFormElement.cpp, v1.43) some time ago as
a fix for bug 25353, marking this as a dup.


*** This bug has been marked as a duplicate of 25353 ***
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE

Comment 5

19 years ago
Dup Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.