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

Yet, people get very upset these days when one performs a trick in a high level language to perform optimization. It's heart breaking to see how much folks utilized every resource they had back then, today, we just waste it. Computers are getting faster, but we are not seeing the results because we have excess. Constraints can be very good, it make's folks resourceful.



These kinds of tricks actually are being done: by the compiler (as long as you give it enough information and don't try to outsmart it) - they're exactly what gets put into optimization passes. Trying to do these optimizations by hand generally turns into a time sink that results in buggy, unmaintainable code, which is, pretty much by definition, too low level to take advantage of current or future compiler optimizations.


If you ever hit a crash in CLR or JVM code and get a full, detailed stacktrace; or if you've ever decompiled an Objective-C binary and ended up with pretty much exactly the source code it was compiled from–that's the result of not crunching programs to death in the name of optimizing every spare cycle.

And this isn't just for developers; this bijection between source and binary enables things like Dropbox hooking the OSX Finder without the Finder explicitly supporting a plug-in system, or Windows Error Reporting sending you reports when your shipped app crashes in production on some client's system.

And either way, I'd much rather my code had proven-safe JIT tricks done to it by the runtime system it's loaded on, than that those tricks be burned into it by the compiler (where they will then become gradually more outdated.) Or, worse yet, that I burn them in there myself by hand-editing the resulting binary, and then have to do the same thing every time I recompile.


See my post above. These tricks are still alive in many areas; cost-constrained embedded systems (where people have knife-fights over penny resistors) and very well trafficked code in operating systems or network code (think software TLB refill on the Xbox 360, or fast path TCP). Runtime systems for languages like Java. Oh, lots of places.

I'll bet that many high-end routers pay very close attention to instruction clocks on their main datapaths.

Optimization is not dead. Pointless optimization should be dead, but isn't.


Generally, people get upset either because the trick is unnecessary (the code is not performance sensitive to begin with) or because the trick is counterproductive (modern CPUs are so complex that it's easy to make performance much worse if you naively "improve" your code). Only a few fools get upset if you use a necessary trick that actually gets the job done.


I'd argue that the results we are seeing are more features for the same development cost.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: