BourbonicPlague on Nostr: Yeah, I love Ruby and when I need perf it’s easy enough to write something in C or ...
Yeah, I love Ruby and when I need perf it’s easy enough to write something in C or Rust and call it via FFI. But this code spends the vast majority of its time waiting on the network.
I was able to run the same code single threaded on my M1 Mac against a local copy of the PostgreSQL DB and it only took 1 hour. But adding the network slowed it down by a factor of 24, hence the need for multiple threads.
It’s always easy to forget just how slow even the fastest network is until you run head first into the problem again. 🤣
Published at
2023-08-08 19:36:14Event JSON
{
"id": "0fef420c5e871f3c72a712b44380c6e094f892c0bfc66f7a79bc83f2e31f1f2e",
"pubkey": "104a9e01bfa9fd7d89920636bf25bb28f1fa5ee4a12201fad462fb79c9b5b2e9",
"created_at": 1691523374,
"kind": 1,
"tags": [
[
"e",
"bcd7d2c193ff9628347c0d889742a401e0acf650e8cf9a18037f60fa35c6150f",
""
],
[
"e",
"79f263cb0a3b83bca7f9ce14077a44e640a6db6035bc18117ea4ef829156df21"
],
[
"p",
"c1831fbe2653f76164421d57db6cee38b8cef8ce6771bc65c12f8543de4b39bf"
],
[
"p",
"c1831fbe2653f76164421d57db6cee38b8cef8ce6771bc65c12f8543de4b39bf"
]
],
"content": "Yeah, I love Ruby and when I need perf it’s easy enough to write something in C or Rust and call it via FFI. But this code spends the vast majority of its time waiting on the network. \n\nI was able to run the same code single threaded on my M1 Mac against a local copy of the PostgreSQL DB and it only took 1 hour. But adding the network slowed it down by a factor of 24, hence the need for multiple threads. \n\nIt’s always easy to forget just how slow even the fastest network is until you run head first into the problem again. 🤣",
"sig": "13a933ceda8d12c61e4d7ededf94d918f23a21ee3eeda7a17fc3aad74c3f96e6dbf61250a462eb391bd8bab8fa08f4b02f60cc0c232d426d2ee2f6f22d76ece8"
}