Re:Page Weight Matters (2012)
by kragen on Thursday October 15, 2015 @07:35PM
(#10396668)
What would be super awesome would be a daily drumbeat about how to slim down and simplify applications, with working, open-sourced code.
Here, I'll beat a drum a little. Maybe it will inspire somebody.
I just wrote this tiny text-rendering engine, mostly yesterday at lunch. On one core of my laptop, it seems able to render 60 megabytes per second of text into pixels in a small proportional pixel font, with greedy-algorithm word wrap. That means it should be able to render all the comments on this Hacker News comment page in 500 microseconds. (I haven't yet written box-model layout for it yet, but I think that will take less time to run, just because there are so many fewer layout boxes than there are pixel slices of glyphs.) http://canonical.org/~kragen/sw/dev3/propfont.c
The executable, including the font, is a bit under 6 kilobytes, or 3 kilobytes gzipped.
Re:Page Weight Matters (2012)
by kragen on Saturday October 17, 2015 @03:23PM
(#10405680)
Thank you, but I don't think it's impressive! It's still nearly an order of magnitude slower than memcpy(). But if we want simpler systems, I think doing experiments like this is a big part of how to get there.
Here, I'll beat a drum a little. Maybe it will inspire somebody.
I just wrote this tiny text-rendering engine, mostly yesterday at lunch. On one core of my laptop, it seems able to render 60 megabytes per second of text into pixels in a small proportional pixel font, with greedy-algorithm word wrap. That means it should be able to render all the comments on this Hacker News comment page in 500 microseconds. (I haven't yet written box-model layout for it yet, but I think that will take less time to run, just because there are so many fewer layout boxes than there are pixel slices of glyphs.) http://canonical.org/~kragen/sw/dev3/propfont.c
The executable, including the font, is a bit under 6 kilobytes, or 3 kilobytes gzipped.