3 ms·
Premature Optimization and the Birth of Nginx Module Development
- Smerity 16y agoI always wondered why an Nginx module that was about generating a circle had such prominence on the Nginx website and now I can say I understand =] Although this was premature optimization I still find it a beautiful hack. The author was still not content with the C solution of actually generating the GIF each time (which took 30ms, actually a long time for servers) and instead reframed the problem at a deeper level and created a beautiful little hack that just modified the palette table.
- jarin 16y agoIf you like that, you should look into old-school color cycling/palette shifting techniques used in the 8-bit era. Someone did it with HTML5 too: http://www.effectgames.com/effect/article.psp.html/joe/Old_School_Color_Cycling_with_HTML5 http://www.effectgames.com/effect/article.psp.html/joe/Old_S... Demo: http://www.effectgames.com/demos/canvascycle/?sound=0 http://www.effectgames.com/demos/canvascycle/?sound=0
- StavrosK 16y agoI've seen that before, but I'm still amazed at how beautiful it is. I can't fathom how simple palette cycling can produce these effects, even when I'm looking at the palette.
- jws 16y agoFortunately we now have widespread data: URIs, so the GIF/PNG twiddling can be done in the client saving even more time! (But please don't.)