Skip to content

Commit

Permalink
pass LOB by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Kautenja committed Feb 21, 2020
1 parent 793b7d3 commit 6953a2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions benchmark/benchmark_lob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using Catch::Benchmark::Chronometer;
// MARK: new limits
//

inline void spam_limits(LimitOrderBook book, int count) {
inline void spam_limits(LimitOrderBook& book, int count) {
for (int i = 0; i < count; i++) book.limit(Side::Buy, i, 50, i, i);
}

Expand Down Expand Up @@ -55,7 +55,7 @@ TEST_CASE("Spam new Limits") {
// MARK: new orders
//

inline void spam_orders(LimitOrderBook book, int count, int variance = 5) {
inline void spam_orders(LimitOrderBook& book, int count, int variance = 5) {
for (int i = 0; i < count; i++)
book.limit(Side::Buy, i, 50, i % variance, i);
}
Expand Down Expand Up @@ -92,7 +92,7 @@ TEST_CASE("Spam new Orders") {
//

inline void spam_orders_random_cancels(
LimitOrderBook book,
LimitOrderBook& book,
int count,
int mean = 500,
int variance = 30,
Expand Down Expand Up @@ -140,7 +140,7 @@ TEST_CASE("Spam orders and randomly cancel orders") {
//

inline void spam_limit_random_orders(
LimitOrderBook book,
LimitOrderBook& book,
int count,
int price_mean = 500,
int price_variance = 20,
Expand Down Expand Up @@ -176,7 +176,7 @@ TEST_CASE("Spam limit orders and occasional market orders") {
}

inline void spam_limit_many_market_orders(
LimitOrderBook book,
LimitOrderBook& book,
int count,
int price_mean = 500,
int price_variance = 20,
Expand Down

0 comments on commit 6953a2a

Please sign in to comment.