HNHacker News
TopNewBestAskShowJobs

dalvrosa

187 karma · joined February 25, 2026

Software Engineer @ Susquehanna | Algorithmic Trading | Low-Latency Systems | High-Performance Computing

https://david.alvarezrosa.com

submissionscomments
dalvrosa··on OpenAI’s Navier-Stokes release included a Lean 4 formal proof
Yep
dalvrosa··on [dead]
Love it
dalvrosa··on Optimizing a Spin-Lock
Thanks!
dalvrosa··on Optimizing a Spin-Lock
A spin-lock is a lock that never sleeps. Instead of yielding to the scheduler, the thread stays on the CPU and spins. No syscalls. No context switches. In this post, we’ll build a version, step by step, that is 5.7x faster while drawing 5.4x less energy.
dalvrosa··on Move in C++ without a std:move
Not sure what you mean, but std::move is one of the greatest tools in C++
dalvrosa··on Self-Hosting on the Dark Web
It is the FBI lol
dalvrosa··on Self-Hosting on the Dark Web
Thanks! Glad that you liked it
dalvrosa··on First Steps on a New Server
Over the last decade I’ve been playing with dozens of servers from multiple providers. These are the steps I’ve been perfecting to get up to speed fast and feel right at home on a new machine. Wrote it down here mostly as a personal reference, but hopefully useful to someone else too.
dalvrosa··on Fundamental Theorem of Calculus
Glad that you like it :)
dalvrosa··on Fundamental Theorem of Calculus
Very. Very nice
dalvrosa··on Fundamental Theorem of Calculus
Thanks for bringing some intuition!
dalvrosa··on Fundamental Theorem of Calculus
Fair, sorry about that
dalvrosa··on Fundamental Theorem of Calculus
Great example
dalvrosa··on Fundamental Theorem of Calculus
Here is used in the Lebesgue measure theory sense
dalvrosa··on Fundamental Theorem of Calculus
Already replied :)

The source code of the website is open if you wanna check it out!

dalvrosa··on Fundamental Theorem of Calculus
There is some geometric intuition in wikipedia page for this theorem you may like :)
dalvrosa··on Moving from GitHub to Codeberg, for lazy people
Fair
dalvrosa··on A Faster Alternative to Jq
Fair, but agentic tooling can benefit quite a lot from this

Opencode, ClaudeCode, etc, feel slow. Whatever make them faster is a win :)

dalvrosa··on Optimizing a lock-free ring buffer
Lol. Funny story :)
dalvrosa··on Optimizing a lock-free ring buffer
Thanks for the explanation :)
dalvrosa··on Optimizing a lock-free ring buffer
Thanks!
dalvrosa··on Optimizing a lock-free ring buffer
I'm not sure about the single-core scenario, but would love to learn if someone else wants to add something

In reality multiple threads for single core doesn't make much sense right?

dalvrosa··on Optimizing a lock-free ring buffer
Thanks. Do you happen to know why hyperthreading should be disabled?

In prod most trading companies do disable it, not sure about generic benchmarks best practices

dalvrosa··on Optimizing a lock-free ring buffer
Nice one!
dalvrosa··on Moving from GitHub to Codeberg, for lazy people
Codeberg vs selfhosted Gitlab. What do you think?
dalvrosa··on Optimizing a lock-free ring buffer
Agreed. For benchmarking I used this <https://github.com/david-alvarez-rosa/CppPlayground/blob/mai...> which relies on GoogleBenchmark and pins producer/consumer threads to dedicated CPU cores

What else could be improved? Would like to learn :)

Maybe using huge pages?

dalvrosa··on Optimizing a lock-free ring buffer
Exactly, that's right
dalvrosa··on Optimizing a lock-free ring buffer
Thanks! That's not ensured, optimizations are only valid due to the constraints

- One single producer thread

- One single consumer thread

- Fixed buffer capacity

So to answer

> Are they ensuring two threads can't push to the same slot nor pop the same value from the ring?

No need for this usecase :)

dalvrosa··on Optimizing a lock-free ring buffer
Thanks for the feedback <3
dalvrosa··on Optimizing a lock-free ring buffer
100% agree +1
← PreviousPage 2 of 3Next →