stupid question: how to build a trading system? anyone got a starter guide, resources?
LMAX Disruptor – High Performance Inter-Thread Messaging Library
11–20 of 89 posts
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#12I am working on a C version of the disruptor ringbuffer it is very simple and I need to verify it so it's probably not ready for others but it might be interesting. Aligning by 128 bytes has dropped latency and stopped false sharing. I have gotten latencies to 50 nanoseconds and up. disruptor-multi.c(SPMC) and disruptor-multi-producer.c (MPSC) https://GitHub.com/samsquire/assembly I am trying to work out how to suppo…
I’ve been down the path you’re on a few times and I love the pursuit. Have built my own over the years about 4 times.
Hardware was much slower in those days so my lower barrier was 650ns. Things got worse appreciably as a function of the number of producers I found.
Some of my most sleepless nights. The funnest nights.
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#13stupid question: how to build a trading system? anyone got a starter guide, resources?
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#14There's a whole new generation of engineers for whom this is new news. Enjoy!
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#15stupid question: how to build a trading system? anyone got a starter guide, resources?
* full kernel bypass (I even implemented driver for the networking hardware)
* everything that could disrupt the application disabled (like SME interrupts, etc.) Memory mapped as huge buffers to prevent tlb lookup failures, etc.
* application consists of threads pinned to specified cores
* each thread on the path of market data to sending the order is never calling the operating system for anything. When not processing anything it is busy spinning.
* all memory preallocated carefully to have it pinned to the local core
* data flows from the networking hardware into one core and then passess through cores using disruptor, each core doing further processing and publishing signals to the next core
* the main insight was that rather than wait for market signals to then decide what to do, you can precalculate your responses up to and including the actual message to be sent to the exchange.
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#16stupid question: how to build a trading system? anyone got a starter guide, resources?
I built a PoC of a 5us trading system (guaranteed 5us response in every situation) for a brokerage house a long time ago, around the time of LMAX Disruptor. It was one man job and I had to start with nothing (they had no knowledge at all). Fun project and I learned a lot. * full kernel bypass (I even implemented driver for the networking hardware) * everything that could disrupt the application disabled (like SME int…
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#17stupid question: how to build a trading system? anyone got a starter guide, resources?
Not a real system, obviously, but a high level overview of what it does: https://www.kalzumeus.com/2015/10/30/developing-in-stockfigh...
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#18stupid question: how to build a trading system? anyone got a starter guide, resources?
I built a PoC of a 5us trading system (guaranteed 5us response in every situation) for a brokerage house a long time ago, around the time of LMAX Disruptor. It was one man job and I had to start with nothing (they had no knowledge at all). Fun project and I learned a lot. * full kernel bypass (I even implemented driver for the networking hardware) * everything that could disrupt the application disabled (like SME int…
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#19Earlier quoted context omitted.
I built a PoC of a 5us trading system (guaranteed 5us response in every situation) for a brokerage house a long time ago, around the time of LMAX Disruptor. It was one man job and I had to start with nothing (they had no knowledge at all). Fun project and I learned a lot. * full kernel bypass (I even implemented driver for the networking hardware) * everything that could disrupt the application disabled (like SME int…
what language do you think would be the backbone for such a system? C/C++/Golang or something high level like node.js/Java
Simple C is most likely, ASM is possible, a language such as OCaml generating C to hook into the low level buffers would be intriguing ... the list is long and largely determined by the experience preference of whoever tackles it.
The major features for performance are to allocate and manage all memory from the start .. determine your thresholds of performance and put everything required together on cold start so as to avoid any thrashing at runtime.
Re: LMAX Disruptor – High Performance Inter-Thread Messaging Library
#20I am working on a C version of the disruptor ringbuffer it is very simple and I need to verify it so it's probably not ready for others but it might be interesting. Aligning by 128 bytes has dropped latency and stopped false sharing. I have gotten latencies to 50 nanoseconds and up. disruptor-multi.c(SPMC) and disruptor-multi-producer.c (MPSC) https://GitHub.com/samsquire/assembly I am trying to work out how to suppo…
Do you think it’s possible to obtain this performance with Rust? I’ve been down the path you’re on a few times and I love the pursuit. Have built my own over the years about 4 times. Hardware was much slower in those days so my lower barrier was 650ns. Things got worse appreciably as a function of the number of producers I found. Some of my most sleepless nights. The funnest nights.
https://doc.rust-lang.org/std/collections/vec_deque/index.ht...