Closed Bug 74918 Opened 23 years ago Closed 23 years ago

appending strings in javascript bogs down mozilla

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 56940

People

(Reporter: mozbug1, Assigned: rogerl)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.2 i686; en-US; 0.8.1) Gecko/20010326
BuildID:    2001032614

Doing document.write('blah'+'blah'+'blah' ... really bogs down mozilla, but
document write('blahblahblah... is much faster.
document.write('blah'); document.write('blah'); ... is slightly slower than one
document.write() but still managable.

Reproducible: Always
Steps to Reproduce:
Go to http://d1.selectacast.net/~jks/writeplus.jsp write1.jsp and writemany.jsp
and compare.
writeplus is 'blah '+ repeated, write1 is everything in one string, and
writemany is multiple document.write()'s.

Actual Results:  writeplus too much longer than the other pages.

Expected Results:  writeplus should be on the order of write1.

I also made the pages write1table.jsp and writemanytable.jsp, but those can't be
compared with the non-table versions.

writeplus.jsp crashes netscape 4.76 on linux but doesn't crash netscape 4.7 on
windows.

IE seems to do a much better job than mozilla with writeplus.
This is a duplicate of bug 56940, 
    
       "O(n**2) and O(n**3) growth too easy with JS string concat"


*** This bug has been marked as a duplicate of 56940 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Marking Verified Duplicate - 
                                                                                   
jks@akula.com: I will cc you on bug 56940 so you can follow its progress.
Also note these reports: 

     bug 40391   "JS + on long strings freezes mozilla, horks Win98"
     bug 64589   "Recursive Javascript/DOM additions crash browser HARD"
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.