tuna.blog
3,518 contributions in the last year@tuanha1508

Engineer. A working journal of system design and design systems: the architecture, the trade-offs, and the decisions behind the things I build.tuna

  • Making a React Native list swipe like Apple Mail

    The swipe felt fine on one email and janked when you archived five fast. This is the half-second of freeze hiding between two swipes, why every obvious fix is a dead end on React Native's New Architecture, and the mix of a UI-thread glide, three compiler flags, and some cache surgery that finally made it glide like Mail.

  • Why native apps never stutter (and your React Native list does)

    Swipe an email away in Apple Mail and the list glides shut every time, even mid-scroll on a busy phone. The same motion in React Native hitches. The reason is not the animation code, it is which worker is holding the paintbrush. A plain-language tour of how iOS actually paints a frame, and why cross-platform apps start one step behind.

  • How an order book works, and why your order just sits there

    Tap buy and your order often just sits in a list, doing nothing. This is the whole machine behind that button, built from zero with no finance background needed: what an order book is, how a trade actually gets made, and the one trick that makes it fast. In C++, with real measured numbers.

  • Calling C++ from Python, and where the time actually goes

    The matching engine settles an order in less time than light takes to cross a room, yet the live dashboard feels laggy. This is what happens at the border between fast C++ and friendly Python, why the border itself is the slow part, and how to find that out instead of guessing.

  • Faking a market: the bots that make an empty order book come alive

    An order book with no traders is just an empty list. To test a matching engine, and to have anything to watch, you write fake traders. Three simple bots, each following one rule, that together produce something that looks unnervingly like a real market.

  • Why this blog exists

    Most of what I learn at work disappears the moment the ticket closes. This is where I keep the reasoning, written half for the version of me who hits the same wall in six months, and half for anyone who reads 'this has to be constant time' and leans in instead of closing the tab.