Confessions of a Wall Street Programmer

practical ideas (and perhaps some uncommon knowledge) on software architecture, design, construction and testing

Measuring Latency in Linux

For measuring latency in modern systems, we need to be able to measure intervals in microseconds at least, and preferably in nanoseconds or better. The good news is that with relatively modern hardware and software, it is possible to accurately measure time intervals as small as (some smallish number of) nanoseconds.

But, it’s important to understand what you’re measuring and what the different edge cases might be to ensure that your results are accurate.

You may ask yourself - “How did I get here?”

In addition to being a great line from David Byrne and Talking Heads (from “Life During Wartime”), this is also a question I often ask myself when looking at log files. Today’s tip is worth the price of the whole blog (i.e., free), but I predict that you’ll be glad you know it.

Shared Singleton’s

Singleton’s are kind of like Rodney Dangerfield – they don’t get no respect. And yet, there are scenarios where a singleton is just the ticket – for instance, when a relatively expensive and/or long-lived resource needs to be shared among a number of independent threads.

shared_ptr’s can help make this easier and less error-prone, but even so there are some edge cases that need to be considered.

FIXing less

Here’s a handy tip for those who (like me) spend a fair amount of time staring at FIX logs.

Beyond Compare

I’ve been a happy user of Beyond Compare on Windows for many years, so one of my big concerns when switching to Mac a while ago was, what was I going to use in its place?