Proebsting's Law: Compiler Advances Double Computing Power Every 18 Years
research.microsoft.com
research.microsoft.com
Processors do a damn good job at optimizing code, and cache locality is more important than you'd think. The CPU blazes through redundant mov instructions like there's no tomorrow.
The good news is that building a fully functioning native code compiler is doable by a single person.
This, of course, won't matter if you spend most of your time in I/O or libraries.
Besides, most of the interesting problems are questions of how many programs you can optimize, not much you can optimize one given program. Automatic parallelization and vectorization is worth an order of magnitude speed improvement, but compilers can only apply it in a small percentage of the cases where it would be applicable.
In any case, that's what I'm working on.
It's actually not hard in principle. There is a very easy algorithm for deciding whether you should use a list or an array: You try it out.
If I fail, I'll write about it some day...
"Any program will degenerate until it is written in a conglomerate of perl and shell script."
There is a windows-corollary: Substitute perl and shell script for VB.
Seriously though, I do think the law is right. It will be harder and harder to push further optimization out of programs. It is much more interesting to look at other problems - and I do think the research went there as well.
"I think we - compiler and VM writers - have definitely been on the wrong track all these years. Instead of looking for ways to squeeze that last instruction out of a function, we should be looking at memoization, lazy evaluation, and other ways to avoid whole chunks of work."
That squares with my experience (as an application programmer, not as a compiler writer). When I've been able to get huge, 2-10x speedups in my programs, it's always been through doing less work, not doing the work more quickly.
At my first job, there was an issue with the communication protocol between the UI and a proprietary database. The engineering department spent a month redoing the protocol with batch calls that fetched data with one command instead of individually retrieving each object. They ended up with about a 5% speedup. Then I looked at the logs and saw that a certain very-common API call was actually making two requests to the database, and the data from the second one was not needed in 99% of cases (it was a holdover from when the product was intended for a totally different market). So I changed the API to lazily fetch the extra data only when it was accessed, and within an hour we had a 2x speedup.
So yeah, existing optimizations have probably reached a point of diminishing returns. But that doesn't mean that new approaches might not result in big speedups.