Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wish all that this guy said is true. I desperately wish a perfect virtual memory can relieve me from all the pains of caching.

Take an example, in a word processor, can we just keep all possible cursor positions (for moving the cursor around) and all line-breaking, page breaking info, each character's location in virtual memory?



Moving the cursor in a word processor is a people-time operation; as long as you can manage it in 100ms or so, it's "good enough". That shouldn't be hard, but somehow LibreOffice still manages to take multiple seconds to update the cursor location...


Let me explain more on the details of moving a cursor:

In a terminal, usually mono-width fonts with fixed font size are used, so cursor positions can be computedly easily.

But for a word processor, variable-width fonts with variable font size are more common. To move a cursor to its next position, we need to know the width of current character, otherwise it does not know where to show the cursor. Should we cache these width or compute them in fly? It is more complicated if a word appears different from as a group of single characters in some languages. Should we cache character positions for these words? Should we keep them all in virtual memory?

Computers may even have no swap partition allocated, can application just reject to run in this case?


I understand that a word processor faces greater challenges in cursor positioning than a simple text editor--that's why I write my documents in LaTeX :)

As for swap, I always figure that if you're hitting swap, you're dead. It's time to buy more RAM. I've had instances where running Firefox and a kernel compile at the same time on my 4 GB laptop turn it into an absolute thrashfest--I have to walk away for 15-30 minutes, because I cannot do anything at that point. Applications, even plain old xterm, are big enough that swapping them in and out makes the machine unusable.


+1 for latex.


My 128k Mac circa 1985 seems to be able to move the cursor around in proportionally spaced text without noticeable lag.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: