denarius-exchange / denarius

An open-source financial exchange
Other
35 stars 5 forks source link

Investigate how market orders make test in core_test fail #15

Open analyticbastard opened 10 years ago

analyticbastard commented 10 years ago

testing "Bulk test: Send 1000 random-side limit AND market orders and check matching" fails most of the time when using market orders. It could look like they consume more time but it only happens rarely, and 9 seconds should be sufficient by any means.

We use the following line to choose the type

order-type (if (= (rand-int 3) 0) :market :limit)

I've set it to

order-type (if (= (rand-int 3) 4) :market :limit)

so that it never creates a market order.

analyticbastard commented 10 years ago

It is worth changing the engine namespace and implement something more efficient. There is a nice library called meltdown which is an interface to Reactor,a inter-thread message passing system much like LMAX's disruptor.