Files
Jhonathan Abreu 153d0b7427
Syntax Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Support Count and Python len() on user-facing lazy enumerables (#9631)
* Memoize order and order ticket enumerables in SecurityTransactionManager

Wrap the enumerables returned by GetOrders, GetOrderTickets and
GetOpenOrderTickets in MemoizingEnumerable so they expose a Count
property, which also enables len() on them in Python algorithms.

* Memoize lazy enumerables in other user-facing APIs

Wrap SubscriptionManager.Subscriptions, SecurityCache.GetAll,
Cash.SecuritySymbols and ICurrencyConversion.ConversionRateSecurities
in MemoizingEnumerable so they expose a Count property, which also
enables len() on them in Python algorithms.

* Add Count property to IObjectStore

Exposes the count of stored objects without loading their content,
which also enables len() on the object store in Python algorithms.

* Revert "Add Count property to IObjectStore"

This reverts commit 84c0a08c7c30f14a6986a7e11dc89ea426606d1e.

* Avoid memoization overhead on engine hot paths

- Revert SecurityCache.GetAll memoization: fill models enumerate it once
  per open order on every fill scan, so memoizing only adds allocations
  and per-item locking on a hot path.
- SecurityTransactionManager.GetOpenOrdersRemainingQuantity and
  CancelOpenOrders go directly to the order processor since they
  enumerate a single time, keeping memoization only for the enumerables
  returned to the user.

* Centralize order ticket memoization decision in private helpers

Replace direct _orderProcessor calls with private GetOrderTickets/
GetOpenOrderTickets overloads taking a required memoize flag, so every
internal call site states whether the enumerable is single-pass (engine
paths) or user-facing (memoized). Also drop the redundant x => true
fallback: IOrderProvider documents null as match-all and every
implementation handles it.

* Coalesce null order ticket filters before reaching the order processor

Preserves the previous behavior where IOrderProcessor implementations
never received a null filter from the transaction manager.
2026-07-21 17:24:37 -04:00
..
2024-07-10 14:17:27 -03:00
2024-07-09 11:08:42 -03:00
2019-10-01 00:26:36 -03:00