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

FWIW, back when I joined Google Search in 2009 the whole company was on a huge latency kick, and yet inline JS snippets in the HTML weren't compiled, and so there were instances where we had to "human compile" Javascript down into its minimum form. Single-character variable names, foreach-loops that look like "for(var i,e;e=c[i++];){...}", ordering statements so that they would GZip better - basically we were trying to simulate an optimizing JS compiler in our heads. I had code reviews turned back because I could save 1 byte in total GZipped size with a different for-loop construction.

Yes, this is insane. No, they don't do this anymore. But I'm glad I had the opportunity to do this (on somebody else's dime), because it made me really think about latency and on the performance trade-offs you make to get maintainable code. Code size is not free; many devs think it is, and they write really bloated SPAs as a result. And there's also a lot of low-hanging fruit that doesn't require lots of engineer effort but gives appreciable latency benefits.



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

Search: