A 120-second marketplace request, fixed

The marketplace pages were slow in a way that made no sense. You clicked a listing and waited. Thirty seconds on a good day, sometimes two minutes. For a page render. My first guesses were the usual suspects, the chain or the database. Neither held up. Nothing was blocked on IO at all, no slow query, no RPC call hanging. The request just sat there, burning CPU.

The culprit was seaport-js, computing signatures for a batch of orders. Bulk listing is a marketplace feature, you sign many orders at once instead of clicking through them one by one, and the signature math for a big batch is CPU-bound. Node runs JavaScript on one thread, so while that loop churned it held the whole event loop hostage. Every other request in the process queued behind it and paid the bill. That’s what made the symptom so confusing, requests that had nothing to do with listings were slow too. I reworked how those signatures got computed. Same orders, same output, one to two seconds instead of thirty to a hundred and twenty.

Here’s the part that stuck with me. From the outside, a pegged CPU loop in Node looks exactly like a network stall. Latency goes up, timeouts fire, every graph points at infrastructure. I nearly went digging through the network layer for a problem that turned out to be a handful of lines of math on the wrong thread. Since then, when a Node service gets slow everywhere at once, the event loop is the first place I look.