sudhanshu shukla

Log

short notes. one paragraph or less.

Small things. Bugs I just hit, a flag I just learned, a benchmark that surprised me. Newest at the top.


Caught this in the LOB last week. std::next on a bidirectional iterator is O(n). I had it inside the insert path. Best-price queries stayed O(1) but the insert quietly degraded on long price levels. The fix was two lines. The lesson is older than that: read your iterator categories before you optimise.

In FlashCache I had a 1:1 wait-to-handle ratio. Bumping the maxevents to 1024 and processing the full batch inside one syscall cut epoll_wait calls by 91% under load (verified with strace -c). Throughput climbed by a third on pipelined writes. Cheap change. Big return.

Spent half a day on a heap-use-after-free in the LOB. The cancel path erased a node from an unordered_map one line after binding references into it. Structured bindings make the bug look harmless. ASan found it in two seconds.