This is a chart of latencies I created quite a long time ago, based on the best estimates I could find.

https://mikedilger.com/latency.html

Notice how slow the Internet is. Bandwidth has increased massively over the years, but latency hasn't because the distances haven't changed (except starlink is closer to earth) and the speed of light hasn't changed.

Notice rotational disks are also pretty slow, 10x faster than the Internet though.

Even SSDs and memory are slow compared to computations. You might be tempted to compute something once and save it to a variable, when in fact it might actually be better to just recompute it over and over in different places in your code. Compilers might improve this for you, or they might not.

What always seems suprising to me is that gigabit ethernet is 1000x faster to respond than your local physical disk! Writing to a server on your network is way faster than writing to a spinning magnetic platter in your local computer.

When writing rust, perfectionists worry about copying and memory allocation. These are the last things to worry about. I think they are useful to worry about, but you need to put it into perspective.

Compare their latency of memory allocation to that of contacting a DVM to sign your event for you. That latter having about 4 network round trips (DNS, SSL establishment, AUTH, and the request itself) takes something like 500,000 times longer. To get a better feel for that difference, if it takes 1 second to do a memory allocation, it takes on the order of 5 days to do a DVM request.

Reply to this note

Please Login to reply.

Discussion

Ha, I see an argument for #Ruby, where even a class is an object 😘

Is it a power supply issue? What if the power standards changed and we started running higher hertz?

You'll need smaller pieces of quartz.

computers are very fast if coded properly. for example if you run a good game like FortNite you will be shocked by how fast your computer is. but then you take the same computer to YouTube and everything bogs down and you feel like you need a new PC.

the last PC i build had 56 logical cores and 8 channels of DDR5 ram ( i am only populating 4 of them so far ). but shit software will run everything single threaded and make everything wait for some kind of response from a server that never comes ...

IMO the real difference is that fast games like FortNite are always eating the entire CPU and the entire GPU power. i have a Kill-A-Watt meter on my big PC and when i fire up FortNite ( or PUBG etc. ) the power draw goes straight to 600 watts and stays there ...

in other words the game doesn't wait. it computes nonstop. it doesn't matter what the speed of the server you're connected to it's burning the full 600 watts all the time.

to summarize i think the secret to speed is to make all the different tasks run on different cores and in such a way that you never wait for anything

shit bogs down when one thing depends on the other and all of your computer resources end up waiting for something that takes millions of clock cycles when you could have had 20+ cores working in parallel but instead nothing is being done at all ...

nostr:npub1acg6thl5psv62405rljzkj8spesceyfz2c32udakc2ak0dmvfeyse9p35c

Agree about leveraging the processor more, and using more efficient algo design and patterns.

There aren't many devs who want to do that sort of work because the paymasters don't care about performance, but we have no paymasters.