Now that we understand the key terms that describe performance at IMC, we can start to use them to talk about the mathematical models that help us to stay competitive in technology-based trading. Performance is key to how we work here, so it’s important that we get it right!
Latency in the trading world
Let’s return to the supermarket analogy we introduced in the first Performance Series article. At peak times, even when the cashier is maintaining a consistent service time, the supermarket is busier than usual. That means we queue for longer and it takes us more time to buy our groceries; or, in performance terms, our response time is slower.
We experience the same latency in the trading world. If there are big movements across markets and our trading servers are fully utilized, we’ll wait longer and therefore respond more slowly. Queuing theory helps to model, and find solutions to, this contention.
Achieving concurrency: scaling to improve service time
By knowing the rate of tasks, deterministic service time and the number of resources, we can figure out our average response time and decide whether we scale or improve our service time. At the supermarket, adding a cashier would decrease our delay and our expected response time.
That’s referred to as scaling horizontally, and it has limitations. Amadahl’s Law shows the impact of speed-up when we add resources. Amadahl argues that the theoretical improvement of adding resources is limited by the aspect of service time that doesn’t benefit from the addition. If the supermarket only has one slow elevator as an exit, adding more cashiers has less impact than adding an elevator.
Mathematically, if half the process is parallelizable then, theoretically, adding resources only leads to a 2x improvement in response time. In the trading world, we solve this contention by balancing load across strategies or products.
Addressing cohesion: the Universal Scalability Law
Amadahl’s answer to our congested supermarket queues solves concurrency, but not cohesion. Cohesion is the cost we incur by trying to solve contention, or by maintaining the concurrency. Having multiple cashiers means we now need a manager to handle them. Trading globally means we have to trade sensibly across the world. The Universal Scalability Law realistically models this behaviour.
These models are important and unavoidable. They help us to understand performance a bit better. Now, we can accurately determine how to optimize our strategies and scientifically prove our expectations in order to make the best trades.
Check out our next article, where we dive into optimization using Java, and explore whether it’s truly fast enough for today’s trading world.