7 ms·
I like to test people’s intuition of computer power by asking them how many multiplications their phone or PC can make in the time it takes light to cross the r
by jiggawatts 3y ago
I like to test people’s intuition of computer power by asking them how many multiplications their phone or PC can make in the time it takes light to cross the room.
The way to estimate this is that light takes 3ns to go 1m. If the room is 10m wide, that’s 30ns. At typical frequencies that’s 100 clocks. With, say, 8 cores that’s 800 steps. At each step a core can retire about 8 multiplies using AVX vector instructions. The estimate of 6,400 multiplications is actually very conservative because you also have the GPU! Even low end models can put out hundreds of thousands of multiplications in 30ns. High end models can do about a million.
When asked, most people estimate “1 to 10”. Even programmers and IT professionals do not have a mental model of how fast computers really are.
- jstanley 3y ago> Even programmers and IT professionals have literally not mental model of how fast computers really are. Or of how slow light is!
- deleted 3y ago[deleted]
- paulddraper 3y agoExactly. Speed of light is not exactly a relatable point of reference.
- jiggawatts 3y agoIt ought to be intuitive for everyone working in software development! The performance of everything is limited in one way or another by ‘c’. Not just WAN links, but the data centre Ethernet as well. The distance to the disks matters. The physical size of the motherboard. The placement of caches, etc… When people say things like “putting the compute near the data” they’re implicitly talking about overcoming the limits imposed by the speed of light. When you hear about an N+1 performance issue in some ORM, that’s bad because of the speed of light. When you test your LAN with “ping”, you’re lying to yourself because it won’t show measurements below 1 ms, which is an eternity. I just told you how much compute can occur in just 10 nanoseconds. Go ping something. Look at the “1 ms” in the output. Go back to my post and work out what can occur in 1,000,000 nanoseconds. Go look at the 1 ms again. Repeat until you have an epiphany about your zone redundant Kubernetes-hosted cloud native microservices architecture.
- deleted 3y ago[deleted]
- BenjiWiebe 3y agoFYI the ping utility in linux shows 3 significant figures. On my lan it's reporting 0.156ms avg between two hosts.
- jiggawatts 3y ago150 microseconds is typical, but for reference, Azure gets about 85µs between VMs in proximity placement groups, and I've heard of single-digit latencies with high-end RDMA NICs. Your ping is 156,000 nanoseconds. You just saw that you can in principle do about 6,400 computations per 30ns, so... that's about 33 million arithmetic calculations per round-trip, within the data centre. I hope this makes you see every unnecessary network hop in a different light. PS: It typically takes 3 round-trips to establish a TCP connection, and 5-7 for a TLS connection. A database connection over TLS needs a few more. And then you have load balancers, firewalls, proxies, envoy, ingress, dapr, and, and, and...
- Dylan16807 3y agoSpeed of light between datacenters is important. Datacenter Ethernet has too much overhead to make a difference in almost all cases. Disks have an even higher overhead:distance ratio. The size of a motherboard only matters for signal integrity, not that half a nanosecond extra. Cache location inside a chip can matter, but even then size is a significantly bigger factor than location.
- dylan604 3y agoExcept we know nothing is faster than light, so that's a reference people know
- pyinstallwoes 3y agoUnless you don’t measure it, then it’s as fast as it needs to be! Oh group velocity.
- elboru 3y agoThis site[0] helped me improve my mental model. You can scroll through the solar system at scale (the moon being one pixel). It takes a while!! Then you notice a small button at the right bottom corner, that button allows you to auto-scroll at the speed of light, wow, now that’s slow! [0]https://joshworth.com/dev/pixelspace/pixelspace_solarsystem.html https://joshworth.com/dev/pixelspace/pixelspace_solarsystem....
- nomel 3y agoMakes you realize that space travel isn't going to happen with current physics.
- deleted 3y ago[deleted]
- porphyra 3y agoThe faster you go, the shorter you have to travel due to length contraction. So travelling really far distances is still possible, for example, by constant acceleration [1]. It's just that everyone you left behind will have been dead for billions of years by the time you arrive. [1] https://en.wikipedia.org/wiki/Space_travel_under_constant_acceleration https://en.wikipedia.org/wiki/Space_travel_under_constant_ac...
- nomel 3y ago> for example, by constant acceleration Yes, this is why it won't happen, with our current understanding of physics, and the practical limitation that implies, with the resources we have. ;)
- bitwize 3y ago> It's just that everyone you left behind will have been dead for billions of years by the time you arrive. sad piano plinks https://www.youtube.com/watch?v=kEVZ3NIoEAE https://www.youtube.com/watch?v=kEVZ3NIoEAE
- rsaesha 3y ago
- chrismorgan 3y agoI’m an Australian. A lot of the internet I interact with is in America, and a lot of the rest is in Europe. These are all hundreds of milliseconds away by fibreoptic cable, the latency of which is proportional to the speed of light. I’ve been to America a few times. The internet is so fast there: not because of bandwidth differences, but because of latency, and especially sites carelessly loading chains of resources, which amplify the effects. As soon as you deal in intercontinental stuff, you realise just how slow light is. (As for studies in the effects of page load abandonment, those are never in the slightest bit relatable—at the time those studies suggest half the people are giving up, most sites still haven’t rendered anything at all, here.)
- citrin_ru 3y agoSpeed of light is the lower bound for network latency but actual internet latency also significantly affected by delays added by network equipment (routers/switches). Typically the bigger distance the more routers there are in between so this delay is also proportional to the distance. And sometimes there are almost saturated channels so there is a significant queuing delay for packets waiting to be sent. RTT AU <-> US will be higher than RTT for most pairs inside the US but RTT for the same distance within the US can vary more than 3x depending on exact network infrastructure on the way.
- Cold_Miserable 3y agoUsing fibre-optic cable where light travels in a zig-zag instead of using lasers increases latency too.
- jebarker 3y agoI recently encountered this from both sides in my work. I was trying to get a particular single-threaded CPU program running in less than 1 microsecond. Light goes about 300m in that time. I remember reading around the same time that the Eiffel Tower is about 300m tall. So it stuck in my head that if someone switched a flashlight on at the bottom of the Eiffel Tower at the same time as my program starts the program should complete before someone at the top of the tower sees the light.
- arp242 3y agoTo be honest I think this is almost a trick question, because you're combining two very different things (speed of light and performance of computers), and people are not very good at combining these sort of contexts intuitively (i.e. you need to do the calculations). The other day I was watching The Twilight Zone, and one episode involves a crew "655 million miles" from Earth. I know what miles are, I know the rough layout and scale of the solar system, galaxy, and universe, but I had no idea how far away that actually is because it mixes these two units from very different contexts and intuitively it just doesn't make sense to me; is it still in the solar system? No idea. Converting it to AU showed it's about 7 AU, which put it in the appropriate context: a bit beyond Jupiter.
- imoverclocked 3y agoThe real question is, "how many Twilight Zone episodes away from ubiquitous quantum computing are we?" (is joke) Units definitely matter but anything outside of our day to day experience is difficult to communicate widely. I think most people don't know more than Jupiter is actually really far away and really really big compared to the Earth. 7 AU means nothing to my brain just like 655 million miles. It's a computed unit based on mean distance from the center of the Earth to the center of the Sun; I also have no idea how far we are from the Sun because my brain just experiences a hot circle in the sky. The only reason these things seem to make sense is because we have seen really vague maps of the Solar System. Other falsely but widely-accepted measures include using state sizes to describe other regions. People readily accept it despite never having been to said state or potentially any other state ... or even across their own state. I think these are accepted because of a false confidence in understanding (think Dunning-Kruger) based on the fact that we have some information. Personal anecdote: A friend flew from the East coast to Arizona and asked if we could just drive to the other side of the state to see the Grand Canyon in the evening. I had to explain that it's 6 hours one-way despite being in the same state. Had I instead said "Arizona is the size of 22 Connecticuts," the idea of how long it would take to get there would still not make any sense. PS: I said "vague map of the Solar System" because generally nothing is always the correct scale. Either the planetary distances are the correct scale from each other or the planets are the correct scale from each other for pragmatic reasons. Sometimes, none of those things are scaled properly. Some animations attempt to show things correctly but that's still difficult to comprehend because of the non-linear velocities required to keep the attention of the viewer.
- rcoveson 3y agoSounds like most people estimate surprisingly well. Fermi-wise, the obscure term in your numerator is 10^10 and the obscure term in your denominator is 10^8. The more obvious term (room size) is 10^1. So the answer is 10^3, and people are guessing 10^0 or 10^1. So some people are only off by a couple order of magnitude, which is explained by a rather small estimation error in either or both obscure terms.
- moffkalast 3y agoAnyone else having a weird deja-vu moment while reading this?
- cogman10 3y ago* Terms and conditions apply What you are saying is technically true but with HUGE caveats. At this point, the issue isn't one of clock cycles but rather memory bandwidth and latency. Even assuming the best case, a hit in L1 cache, you are looking at +1ns to move the data from memory into the registers. But now talk about L2, L3, or worse system memory? Oof. And then you mention GPUs, but that problem is compounded 10x due to the bandwidth constraints of PCIe. I mean, sure, if your CPU is doing nothing other than multiplying the same value by 2 over and over again, it can do that wickedly fast. However, once you start talking about large swaths, gigs even, of data to operate against and those numbers start to take a precipitous drop. Heck, one of the benefits of AVX isn't the fact that you can do 64 lanes of multiplication at once, but rather the fact that you can tell the CPU to grab 64 lanes worth of memory to work against at once. This is why when you start looking at what is talked about when people talk about next gen math machines, it's not the FLOPs but instead the memory fabric that gets all the attention.
- jiggawatts 3y agoTypical PC system memory bandwidths are on the order of 64GB/s with DDR5. That’s 64 bytes per nanosecond, or 16 floats per ns, and hence 480 in the time needed for light to go 10 meters. That’s the “base” performance. Caches and registers would improve on this significantly in realistic scenarios. Again, this is why I like this thought experiment! It’s not a trick question. It’s testing intuitions. People just think it’s a trick because their intuitions are so ridiculously out of whack with reality that they’re looking for the sleight of hand instead of reexamining their own notions.
- cogman10 3y ago> That’s 64 bytes per nanosecond, or 16 floats per ns, and hence 480 in the time needed for light to go 10 meters. Again, terms and conditions. The slow part for memory access isn't how much memory can be piped over the wire but rather how fast a request for the next chunk of memory can be issued. So while it's possible to get those 480 multiplications that relies on the cache being warm and the memory access being predictable to the CPU. If either of those two constraints are violated, then the number of multiplications is severely decreased. In other words, the more frequently you have to tell the memory controller to get more memory, the less work you can do. To put it in perspective, it costs around 100 cycles to load something from main memory. Imagine you are talking about something like an n body simulation that may be accessing memory all over the heap. In the worst case, you are looking at 4 multiplications (if multiplying by a scaler) and perhaps even just 2 multiplications if you need 2 memory pulls per multiplication. Caches don't just help, they are necessary to come anywhere near achieving that 480 number. Just a little history lesson. Once upon a time, the memory controller didn't exist on the CPU, it was on a separate chip (the north bridge). Whenever the CPU wanted to load memory, it'd send a request to the north bridge and the north bridge would send that request to main memory. One of the huge improvements to CPU performance for both Intel and AMD was integrating the memory controller onto the CPU. Why? Because they shortened the distance a request for memory, and the memory itself, had to travel significantly. Electrical signals travel at about 2/3 the speed of light and if your memory is 0.1 meter from the CPU, you can see how many requests for a new chunk of memory can really slow down everything. This is fundamentally why nVidia's big GPGPU processors they sell to datacenters come chock full of memory. Because they want to limit the amount of time and times the GPGPU has to reach back into main memory to process stuff. It's far quicker to load up the 20gb of ram on the card in one go then to need to constantly pull that data over the PCIe line.
- ball_of_lint 3y ago1-10 is pretty accurate for a single CPU with random memory access. Sure, the GPU can physically perform many more in parallel, but then you get into the exact size of the gpu and how fast you can copy to/from memory to it which isn't the point of the question.
- ipython 3y agoYou should bring up Admiral Grace Hopper’s description of this on the Letterman show: https://m.youtube.com/watch?v=oE2uls6iIEU https://m.youtube.com/watch?v=oE2uls6iIEU
- Solvency 3y agoAnd yet: Electron apps.
- circuit10 3y agoIt is amazing how much of that incredible performance we can eat up and then end up with something slow anyway And also the fact that we eat up just enough of that performance for it to be slow sometimes but usually no more, because we can’t
- solardev 3y agoIsn't this kinda like a convoluted version of a FLOP?
- photochemsyn 3y agoMaybe something like "starting from 2, how many sequential prime numbers can your computer generate mathematically, in the time it takes light to cross the diameter of the Earth" would be a more interesting measure?
- devoutsalsa 3y agoWhat is the relative velocity of the computer? Is it moving at 99.999% the percent the speed of light relative to the observer? In what reference frame is the observation being done?