Comments (4)
No, I haven't used use_pyo3
logging. I haven't changed the code. I'm only changing the Nautilus version.
I'm loading both 1-min bar and 5-min bar data, since my strategy subscribes to 5-min bars. The 1-min bars helps with producing more accurate fills.
I did observe something related to that that might provides some clues:
- When loading only 1-min bar data, and having the strategy subscribe to 1-min bars, the performance on both 1.88.0 and 1.89.0 is similar (around ~30 secs).
- Also, loading only 5-min bar data and having the strategy subscribe to 5-min bars, the performance on both 1.88.0 and 1.89.0 is similar. (around ~6 secs)
- However, loading both 1-min and 5-min bar data and having the strategy subscribe to 5-min bars, that's when the performance is different. (~9 secs in 1.88.0 and ~33 secs in 1.89.0).
Did something change related to how bars are loaded or processed?
from nautilus_trader.
Hi @dkharrat
I can't see anything obvious so far, did you start using the use_pyo3
logging option by any chance?
I generally run some of the example backtests periodically and can't see any significant performance change, I wonder if this might be specific to bars in some way?
from nautilus_trader.
Hey @dkharrat
Thanks for going through this and providing the extra information. There's a chance this could have something to do with a change to how the message bus processes published messages (including bars), but I'll have to test.
from nautilus_trader.
So after a lengthy investigation this was tracked down to a subtle edge case with the MessageBus
topic resolving.
The issue
A bug was fixed for the 1.189.0 release whereby it became possible to subscribe to topics which previously had messages published with no subscribers.
This change caused a performance regression where messages being published without any subscribers would always go through an expensive topic/pattern resolving operation.
The fix
Now fixed from d28da76 with a simple boolean flag.
Whenever subscribe
or unsubscribe
is called on the bus, its put back into an "unresolved" state until the next message is published with has no subscribers. There is still an edge case existing where multiple of these "no subscriber topics" could need resolving (and only the first one will resolve), however this at least fixes the most common use case and performance regression.
Let me know if this fix works for you when you get a chance.
from nautilus_trader.
Related Issues (20)
- Addition of Sequence Number in QuoteTick HOT 2
- Polygon.io integration HOT 1
- Sandbox: Error on applying OrderFilled due to incorrect venu_order_id HOT 5
- Sandbox: fills are applied multiple times to the same limit order HOT 10
- Timer is panicking when calling `set_time_alert_ns` HOT 9
- Sandbox: fills are generated by internally aggregated bars instead of quote/ticks HOT 4
- Get radis error in trimming stream HOT 8
- Incorrect import for OrderBookImbalance example strategy HOT 1
- Low level backtest in documentation needs some adjustments so it works straight away HOT 2
- Cannot pull out account information in SANDBOX mode HOT 4
- Improve error message when no tick scheme for instrument HOT 3
- Multi-currency support for SANDBOX mode HOT 1
- Orders accepted and not filled in SANDBOX HOT 10
- Latency modeling for sandbox/real-time HOT 1
- Highlevel api tutorial document bugs HOT 1
- Invalid size precision for fill 5 when instrument size precision is 6, on 1.194.0 HOT 4
- Documentation - clang is a "From Source" installation dependency HOT 2
- Backtest in streaming mode doesn't work HOT 6
- How to handle orderbook snapshots HOT 10
- Binance missing candles HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nautilus_trader.