3 ms·
tl;dr - Premature optimization is (still) the root of all evil. I'm not familiar with squid, but I'm quite familiar with the idea of programmers writing their
by georgemcbay 14y ago
tl;dr - Premature optimization is (still) the root of all evil.
I'm not familiar with squid, but I'm quite familiar with the idea of programmers writing their own systems on top of other systems that are basically a worse implementation of something the underlying system is already doing.
To my chagrin, I occasionally catch myself doing this sort of thing once in a while when I'm first moving into new language/API/concept and don't really understand what is going on underneath.
It is always a good idea to try the simplest thing that could possibly work first, and then measure it, and only then try to improve it and always make sure you measure your "improvements" against the baseline. And make sure you're measuring the right things. I think this is a concept most developers are aware of but one of those things you have to constantly checklist yourself on because it is too easy to backslide on.
- marshray 14y agoExcept that the primary purpose of a web cache is to utilize storage to avoid duplication of work. Caching is a fundamental operation the storage hierarchy, so as soon as the possibility exists that your cached data will exceed available physical RAM, you're "optimizing" disk IO whether you admit it or not.
- qznc 14y agoOne reason to reimplement something on top is portability. The tradeoffs between portability and performance are hard.
- fleitz 14y agoIt's still generally a bad idea, it's much better to write an interface and then provide multiple implementations that take advantage of the native features of the OS. I think we all remember the last that language that decided to be so portable they shipped their own reimplemented GUI toolkit with the standard library.
- Deestan 14y ago> it's much better to write an interface and then provide multiple implementations That is a reimplementation.