3 ms·
An awful lot of professional programmers work in such heavyweight contexts that they don't have a good idea of how fast modern hardware can be. I was talking w
by wpietri 5y ago
An awful lot of professional programmers work in such heavyweight contexts that they don't have a good idea of how fast modern hardware can be.
I was talking with an architect at a bank whose team was having trouble getting under a 2-second maximum for page views. They blamed it on having to make TCP requests to other services, and said something like "at a couple hundred milliseconds per request, it adds up quickly!" My head nearly exploded at that. I spun up some quick tests in AWS to show exactly how many requests one could make in 2000 ms. I don't have the numbers handy, but the number is very large.
This junky slice of a server handling full page requests in 20 ms is a fine example to counter thinking that's endemic in enterprise spaces.
- dragontamer 5y agoI had a discussion with a coworker about something about slow memcpys, that roughly went the same way except... you know, DDR4 RAM has a speed of roughly 40GBps. Also, that "awful" 1MB memcpy is likely all in L3 cache these days. But even if it weren't in cache, we're talking about an operation that takes 50 microseconds (1MB read + 1MB written == 25microseconds + 25 microseconds). Given that modern CPUs have like 16+ MBs of L3 cache (and more), and some mainstream desktop CPUs have 1MB of L2 cache... its very possible that this memcpy is far faster in practice than you can imagine. 1MB is big, its a million bytes. But CPUs are on the scale of billions, so 1MB is actually rather small by modern standards. Its surprisingly difficult to get intuition correct these days...
- wpietri 5y agoFor sure. I think keeping one's intuition for systems updated is one of the biggest quests for anybody trying to have a career in tech.
- ppeetteerr 5y agoThis is a person running a blog and pulling HTML data from a database. Is it that impressive that they are getting 50r/s?
- wpietri 5y agoIt's not. My point isn't that it's impressive in some ultra-tuned performance sense. It's that doing pretty mundane things on pretty basic servers is still very fast compare with a) the past, or b) what a lot of developers are used to professionally. That's why it is interesting to the crowd here.