Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Performance bug with newline replacement on IE 6-7 (patch included) #102

Closed
GoogleCodeExporter opened this issue Apr 22, 2015 · 3 comments
Closed

Comments

@GoogleCodeExporter
Copy link

I noticed that on extremely large files - say, 3000 lines of code inside a 
single <code> tag - IE 6 and 7 spend the vast majority of rendering time 
replacing <br>s with \r\n after the rest of the markup has occurred. By 
choosing the appropriate newline style inside recombineTagsAndDecoration, we 
can eliminate the replacement step at the end.

I've attached a patch that implements this. On the aforementioned 3kloc test 
file, it reduces IE7 rendering time on my computer from 40s to 10s, with 
similar results for IE6.

Original issue reported on code.google.com by jacobly@google.com on 10 Dec 2009 at 7:52

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks so much for profiling.  It's really hard for me to run one since I can 
only run 
IE under VMWare which is a royal PITA.

I'll try incorporating this when I get a chance.  Do you know where time under 
IE8 is 
spent?

Original comment by mikesamuel@gmail.com on 10 Dec 2009 at 8:31

@GoogleCodeExporter
Copy link
Author

I just found out that IE 8 has an actual profiler, a pretty good one. I 
actually didn't 
realize earlier that this issue affected IE 8 as well, but it does.

With the patch to prettify.js, the time spent is actually fairly 
well-distributed (without 
it, there's an extra 24 seconds inside replaceWithPrettyPrintedHtml). Out of a 
total of 
1400ms, the largest contributor was emitTextUpTo at 750ms (including its 
callees in 
the time spent). This function was called 25000 times, so that's not too bad. I 
was 
actually very impressed with how fast IE 8 is on this page. In all of these 
cases, the 
total time spent in a function exceeded the time spent in its callees and in 
its own 
body, meaning that a large body of time is spent in IE itself, doing rendering.

I've attached a csv file exported from the profiler.

Original comment by jacobly@google.com on 10 Dec 2009 at 9:27

Attachments:

@GoogleCodeExporter
Copy link
Author

Patched in at revision 95.  Thanks much.

Original comment by mikesamuel@gmail.com on 10 Dec 2009 at 11:25

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants