Welcome to MSDN Blogs Sign in | Join | Help

Syndication

Tags

    No tags have been created or used yet.

News

These postings are provided
"AS IS" with no warranties,
and confer no rights.
Why notepad is sometimes slow opening large files and how to make it fast

Ever notice how notepad can be really slow opening large files? Yeah I know why use notepad at all? For the simple reason that it might be the only editor on some random server that you logon to look at logs etc. Well there is Wordpad too but the default association for text and log files is to notepad and by the time you've double clicked a log file it might be too late. Also Wordpad is more heavyweight and can be lot slower scolling through and searching for text etc.

So you open some really large log file (in notepad) and notice the excruciatingly long time it takes. One day I got really frustrated and decided to investigate a bit. After a while I realized that even actions like maximizing or changing the size of the window took very long and a light bulb turned on that somehow notepad is redoing the whole layout of the text again so perhaps the word wrap feature is responsible. After all the word wrap feature (menu Format->Word Wrap) causes notepad to break lines at the visible width so that must be taking some time. Turns out that indeed if you switch word wrap off notepad becomes lightning fast. I tested with two log files of 11 MB and 103 MB on a Dual P4 3.2 GHz with HyperThreading on. For the 11 MB file I got times of around 16 s with word wrap on and 1.5 s with word wrap off! For the 103 MB it was 135 s and 15 s! I couldn't believe it was so simple and hadn't heard about this anywhere so I asked the people in my team if anyone knew about this. Apparently no one knew. I wonder how many people have realized this.

Now the problem is that at some point in time you've probably turned on word wrap in notepad and then forgottten all about it. It stays on and you keep suffering slow notepad file open times. I wish notepad had an option to turn word wrap off for files above a certain size. After all most text files you are going to use word wrap on wouldn't be too big. My suggestion is to keep word wrap off all the time and just make the default size of notepad as big as your screen allows. And if you really do need to use it then don't forget to turn it off lest you find yourself cursing the next time you open a large file :)

Published Monday, September 12, 2005 12:36 PM by shivram

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Why notepad is sometimes slow opening large files and how to make it fast @ Friday, November 11, 2005 12:56 PM

I am familiar with this feature, but what I can't figure out is why on one system log 50+ meg log files open almost immediately and on my other system they can take a minute or more. Both systems are dual Xeon, 400 FSB, 1 Gb+ memory, it doesn't make sense. Neither have word wrap on. If anyone has any ideas, please let me know at elevy_NO_SPAM_REMOVE_THIS@WeatherMetrics.com

Eric Levy

# re: Why notepad is sometimes slow opening large files and how to make it fast @ Sunday, December 04, 2005 10:44 PM

I'm only guessing ... Perhaps it has something to with the display or disk drivers on the system? Maybe one of them has either crappy drivers or suboptimal drivers which causes the slowdown? I don't know how much display device drivers speed up the font rendering process, Perhaps bad ones take much longer to render fonts (do display drivers even implement significant parts of font rendering)? Have you tried to measure if the slow file opens aren't a general slow disk read problem?

shivram

# Amazing how fast search engines have made one of my blog posts the top result for "slow notepad" @ Sunday, July 16, 2006 3:38 AM

It's amazing and funny how fast my post about the slow notepad issue has become the top result when you...

Shiv's random musings on computing

# re: Why notepad is sometimes slow opening large files and how to make it fast @ Monday, July 17, 2006 2:42 AM

Eric: The other drive is probably in PIO mode. Right-click "My Computer", select "Manage". Open up the "Device Manager" node, then expand "IDE ATA/ATAPI controllers". Right-click on "Primary IDE Channel" then click "Properties". In the "Advanced Settings" tab, check that "Transfer Mode" is "DMA if available" rather than "PIO Only". Do the same for "Secondary IDE Channel".

Dean Harding

# Shiv s random musings on computing Why notepad is sometimes slow | home lighting @ Friday, June 19, 2009 1:48 AM

PingBack from http://homelightingconcept.info/story.php?id=814

Shiv s random musings on computing Why notepad is sometimes slow | home lighting

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
Page view tracker