Wednesday, January 21, 2009

Notepad

How to make Notepad use 100% of your CPU time for entirely too long:

1. Open this file [external link to 45,647 bytes of what appears to be broken UTF-16] in your browser, as ISO-8859-1.
2. Select all the text.
3. Open Notepad.
4. Paste the text into Notepad.
5. Select and copy any of the tens of thousands of little black squares.
6. Hit Ctrl+H (or select EditReplace... from the menu).
7. Paste the black square into the Find what: field.
8. Make sure the Replace with: field is empty.
9. Hit Ctrl+A (or click Replace All).
10. Go make a cup of coffee.

Tested on Windows 2000 with a years-old machine, so yours will probably run, oh, maybe even twice as fast.

I wouldn't be surprised to learn that the limiting factor is actually "waiting for screen refreshes", since search-and-replace is displayed in realtime. Then again, I typically stress this poor single-core single-CPU box to the limit; I do have Firefox running with a thousand tabs open (modulo hyperbole), so it could just be millions of context swaps and page faults. (I would know for sure if Task Manager had been responding to input; but it wasn't, despite being at High priority.)

No comments: