Notepad lag
Several weeks ago, I think I figured out why Notepad lag exists. I kept forgetting to post it to the site, which I'd very much wanted to do because I remember having complained about it in an earlier update. It's due to the simpler but less efficient way the program stores your input. Notepad, it seems, stores it linearly, one character after another in an array that holds only characters. Think of it as a superlong bus where each row has one and only one seat and all the kids are seated alphabetically. It's easy, then, to let more z-last-name people sit at the back of the bus (where, natually, the cool kids are), but adding anyone with, say, an "h" last name would necessitate moving every single person back one row. It's similarly easy to shift the to play around with things at the end of your input—but much more annoying to edit anything in its middle because that would require shifting every single character one place back for each thing you insert. So that's Notepad. I think.

Now, if those rows were detatchable and re-arrangeable, like some roller coaster cars, things would be much easier—you could simply separate the chain of rows where you wanted to fudge with it, and link it all back up when you're done. The problem is that each link costs a lot (for Six Flags, it'd be money; for software, it's memory). So, they compromise by making each car super long. Real word processing programs probably store your stuff in linked blocks. Think of it as subway cars, also with one seat per row. If each car had 20 seats, you could move around just those 20 people until you achieved alphabeticality. If you wanted to add more people to a certain car than it could hold, you'd simply split off the latter half into a separate car and insert that new car in between the old one and the one that was previously after it. Empty seats [empty cells in the block] are simply skipped when you're going through the kids on the subway [the characters in your computer's memory]. Yay!

This was from CS waaay back in the nether reaches of February. I'd just recently connected it directly to Notepad's performance. It could very well be wrong (please bludgeon me with a blunt, heavy object or an email if you're sure that it is), but for now it soothes the prick of annoyance that stirs inside me every time a plain text file, such as the ones I work with to edit my site, gets too long and bulky. And I thought that maybe you'd care. Well, not really.
Filed under: Geekery.