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.
Mike Dilger ☑️
mike@mikedilger.com
npub1acg6...p35c
Author of Gossip client: https://github.com/mikedilger/gossip
Dual National (USA / New Zealand)
My principles are Individualism, Equality, Liberty, Justice and Life
Gell-Mann amnesia applies equally well to Trump's statements. You know his past statements were meant to confuse and distract. Why should you ever think that his latest statement is somehow true this time?
Subway menu: ... foot long: $27.90...
me: "how long did I sleep?"
I find it fucking insane that Israel was stopping a US hostage from being rescued, and now that the US went around them and got him giving NOTHING in return, pro-Israel influencers are pissed off. If that doesn't shine a light on what is really going on, I don't know what will.
Things are looking up.
I think Trump has known what is going on for a long time, but it takes a lot of setup to do anything about it without being... um... 86ed.
git-lfs on github is a nightmare, with their budget system, which when it fails then every user of the repository can't checkout certain commits!
mike@lys:~/devel/NOSTR/egui$ git checkout 0.31.1
Updating files: 100% (372/372), done.
Downloading crates/egui_demo_app/tests/snapshots/clock.png (335 KB)
Error downloading object: crates/egui_demo_app/tests/snapshots/clock.png (2c15a74): Smudge error: Error downloading crates/egui_demo_app/tests/snapshots/clock.png (2c15a74a1b1ed3b52a53966a3df2901ca520b92fbfbd10503e32ddb8431e1467): batch response: This repository exceeded its LFS budget. The account responsible for the budget should increase it to restore access.
Errors logged to '/home/mike/devel/NOSTR/egui/.git/lfs/logs/20250516T101038.154561498.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: crates/egui_demo_app/tests/snapshots/clock.png: smudge filter lfs failed
I wonder if I should write a guide on "Advice for writing Large Rust Programs" in coordination with @jb55 and @Yuki Kishimoto and maybe others...
Use 'interior mutability' as often as you can. It will help prevent you from accidentally locking far too much, and it will make the struct Send and Sync so it works nicely with async code.
View quoted note →
What's happening with Gossip?:
Implementing NIP-46 support in gossip has been far more difficult than I expected, at every step of the way, to the point that I've become dejected. I'm primarily motivated by progress and currently I am demotivated by my lack of completing anything useful for the end users, and have become too easily distracted to the point that I think it would be fair to send some bitcoin back to OpenSats as a refund.
For a long time there was a rust compiler bug around lifetime erasure ('_ vs '0) of data sent across async points. But I noticed that wasn't happening about a month ago.
Then all the signing/encrypting/decrypting functions needed to be made async, which bubbled up to more and more code needing to be async.
Then I went ahead and defined a Signer trait implemented by anything that could sign things... but that had too many functions (NIP-46 only does some) so it had to be broken up into 3 or 4 traits over time.
Then I built an Identity which could be any of (None, PublicKey, PrivateKey, RemoteSigner), and also a gossip client identity that wrapped this. And it had to be Serialize/Deserialize to save it.
Then I needed a network-level Client that a nip46 signing client could utilize to communicate with it's remote signer, without being tangled up in the "minions" I currently have.
Then I needed the nip46 signer itself that uses this Client and implements Signer, plugged into Identity and Serialize/Deserialize.
Then I needed to migrate how your identity loads and saves to this new serialized Identity (instead of just keys as it used to be).
Then there were lots of bugs around where detection of whether you could sign things or whether things were unlocked was being done wrong.
It starts to work... you can connect to the signer and you can learn your public key, and you can then get a feed. But it quickly gets jammed up and gossip freezes.
So now I think I should use tokio_console to debug it, which requires me to instrument lots of code.
And I'm just so tired of this.