One of the trade-offs we've continually made in computing is between general performance and <i>legibility of</i> performance. Caches (i.e. the memory hierarchy) is one example of that, but we also have pipelining and ILP. Moving up into software, we see this with garbage collection and (more dangerously) with databases. PostgreSQL is great at taking complex queries (many, many joins) and turning them into things that (often) can be very quickly executed. Of course, there's no silver bullet. If your join is a full Cartesian product over two or more large tables, you're screwed. If you assumed that the table was set up with certain "obvious" indexes and it wasn't set up that way, you can get burned on that.<p>We've built systems that are very fast, but almost no one knows <i>why</i> they are fast and when those speed advantages go against us (which is quite rare) it's often unclear why. For the most part, all of this has been a huge win. It might make reasoning about performance from first principles ugly, if not impossible, but the economics favor it. That said, we're at the point where the only way to reason about performance in many real-world systems is empirically, because there's just so much going on in terms of memory hierarchy, network traffic, etc. that is hard to predict in advance. Combine this with the myriad variables, some in the physical world, that can influence performance... and what we end up with is that results that seem meaningful (30 percent faster!) might be artifacts of differences in configuration.<p>That said, I don't think the term <i>computer science</i> was coined with performance measurement in mind but, all that said, the field is not really a science. It's a mix of mathematics, microeconomics, design and engineering... with a lot of science involved, but most often not <i>scientific</i> under the original, strict definition of the word. Science is about investigating the natural world and finding the right answers; CS is about <i>making</i> answers. And they're both extremely important, but fundamentally different.<p>Also, just to underscore how difficult CS <i>is</i>, I tend to think of it as a branch of mathematics that lives on an unfair playing field. Reasoning about <i>arbitrary</i> code, in even the most trivial ways, is known to be impossible (Turing, Church, Rice) and much of CS is contending with the obscenity of arbitrary programs (i.e. often having to quantify over the space of programs) and, typically, that means limiting what can be written while still retaining as much power as is needed.