Two early-outs on the per-message matching hot path, which runs millions of times
per backtested month:
- OrderLifecycleManager.GetExpiredOrders/ProcessTime allocated a List on every
call even when no order had an expiry set. Return an empty enumerable when
there are no tracked expiry times.
- MatchingEngineAdapter.CheckLimitOrders read BestBid/BestAsk and scanned the
active orders on every tick/quote. Return immediately when no order is resting,
skipping those reads and the scan in the overwhelmingly common case.
Both fire only when the respective collection is empty, so whenever orders exist
the original path runs unchanged and backtest results are unaffected.
Move 9 core matching engine files (OrderBook, OrderMatcher, PortfolioManager,
MarginController, OrderLifecycleManager) into standalone MatchingEngine project
with namespace StockSharp.MatchingEngine. MarketEmulator stays in Algo.Testing
and references MatchingEngine. Update all solution files and test references.