Menu

#85 Unnecessary poor performance

open
nobody
None
5
2010-08-01
2010-08-01
Anonymous
No

I did some profiling on Firefox. Two things really slow performance and surprisingly are just not necessary in most use cases.

1) All the calls to getTextHeight from fixLinesHeight. By default it's monospace and most people would keep that, so it'll be a constant line height. This saves about 40% of load time on large files.

2) The 'set unselectable text' stuff in init is not necessary. I don't think much needs to be unselectable and this function is a hog. It would be much better to make any cases where something is unselectable self-specify rather than traverse the whole DOM. Another 40% load time on large files.

So I was able to cut off 80% of load times on large files just by commenting out some corner-case code.

Discussion


Log in to post a comment.