PingPong.jl icon indicating copy to clipboard operation
PingPong.jl copied to clipboard

Performance tweaks

Open untoreh opened this issue 1 year ago • 1 comments

backtest

  • [ ] There are many repeated function calls like openat,closeat,etc... that could be memoized
  • [ ] Consider either removing getproperty for asset instances and strategies or replace all dot accessors within SimMode with some getfield wrapper function. Because the getproperty accessor is slower than getfield if it is customized
  • [ ] an alternative implementation for orders/trades would use arrays instead of structs to be more allocation friendly

watchers

  • [ ] StructArrays or TypedTables could be used when fetching (streaming) ohlcv data feeds
  • [ ] OHLCV watcher implementations parse the whole python dicts into named tuples (CcxtTrade, CcxtTicker), in cases where full parsing is not required, the python data should be parsed more lazily

other

  • [ ] Scour the codebase for lazy use of @view/s on assignments, that should be replaced with copyto! (starting from Data)
  • [ ] search/replace Period with FixedPeriod to see if union splitting improves performance
  • [ ] Full specialization: many functions signatures are defined over generic types (non fully parametrized), benchmarks are needed to assert if full specialization is worth the extra compilation time / bin size

untoreh avatar Jan 27 '23 13:01 untoreh