logoalt Hacker News

hinkley • last Wednesday at 9:36 PM • 2 replies • view on HN

I still maintain that Knuth served us well for about 5 orders of magnitude increase in compute and who can really expect more than that?

We need a new notation for the next 3 orders of magnitude and arguably the last two that accounts for physics. There is not any such thing as an O(1) memory lookup. There really never was. They were O(k) and k was fixed for each model of computer, but not between them, which makes it not a constant that you can eliminate.

In an age where we have Cloudflare bragging about eliminating a TERABYTE of memory from a problem domain, not once but twice, you're talking about speed of light delays outpacing nlogn.

There are already a bunch of algorithms we use, for instance, which complicate hashtables with an additional logn term and achieve substantial speedups over a naive algorithm, because of memory topology. And we don't have a way to express that except via tech blog.


Replies

nwallin • last Wednesday at 10:13 PM

I agree completely.

We have computer science, the theoretical discipline that is most closely related to math. And we have computer science, the engineering discipline that is most closely related to electrical engineering. We give these disciplines the same name, even though they typically have precious little to do with each other. These two disciplines don't agree on what the word "fast" means. While this isn't necessarily a bad thing, and it's not as if one is right and the other is wrong, it's something we need to keep in our minds when we talk about these things.

➕ show 1 reply
jltsiren • last Wednesday at 11:18 PM

The external memory model is from the 1980s. You have unlimited external memory and a cache of size M, and you can copy data between them in blocks of size B. Computation is assumed to be free, and you pay a unit cost for each copied block. It's a pretty reasonable model, as long as the cost of computation is negligible relative to I/O.

And that evolved into the cache-oblivious model in the 1990s. The model is essentially the same, except that you don't know the parameters M and B. It's reasonably good at modeling systems with multiple levels of caches, as long as memory access is the actual bottleneck.

You can do the same thing with other operations as well. If you can assume that a certain operation is the bottleneck, you can analyze algorithms by counting those operations and ignoring everything else.

Things become problematic when there is no single bottleneck. You could introduce multiple cost units (such as computation and I/O) and analyze algorithms in terms of them. But then the cost units are incomparable in the general case, and you have to make specific assumptions about the environment to compare the performance of two algorithms.