Hacker News new | past | comments | ask | show | jobs | submit login

wordstar sort of did this but saved the soft line breaks and hyphens with the high bit set. that way, the distinction between paragraph breaks and formatting wraps was preserved, but it didn't have to redo all that text wrapping work when you opened the file—important on a 4-megahertz z80, which is what i was running it on

testing with http://canonical.org/~kragen/sw/dev3/propfont.c i need about 110 instructions per byte to naïvely word-wrap text and render it to a pixel buffer in a proportional font. this suggests that the z80 could probably have wrapped about 5000 characters per second (in a proportional font), while a 48-megahertz cortex-m0 running 40 million instructions per second could wrap about 400 kilobytes per second, so while there's a strong human-factors reason to cache this kind of presentation information between screen frames, it doesn't really need to be cached between file opens

(the problem gets easier if you don't have to render the text to pixels, or in a fixed-pitch font, both of which applied in wordstar's case)




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

Search: