Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Restack stream base classes, fix stack overflow scenarios #1208

Merged
merged 21 commits into from
Jul 15, 2024

Conversation

DaveSkender
Copy link
Owner

@DaveSkender DaveSkender commented Jul 6, 2024

Partially implements:

Also fixes:

  • test: missing core observer/observable tests cases
  • refactor: inherited observer methods; consider merging concrete StreamProvider and inherited methods in IStreamHub
  • test: one QuoteHub with all indicators subscribed (massive parallel)
  • test: one QuoteHub with max possible chain depth (massive serial)
  • performance tuning, 10x
  • test/consider: forcing concrete types for observables, cached quotes (to reduce stack overflow risks).

@DaveSkender DaveSkender added this to the v3 milestone Jul 6, 2024
@DaveSkender DaveSkender self-assigned this Jul 6, 2024
@DaveSkender
Copy link
Owner Author

DaveSkender commented Jul 8, 2024

with record struct types

Method Mean Error StdDev
AdlHub 1,832.0 us 8.44 us 7.48 us
AlligatorHub 1,809.6 us 13.03 us 12.19 us
EmaHub 1,824.0 us 15.15 us 14.17 us
RenkoHub 629.5 us 4.58 us 4.06 us
SmaHub 1,810.4 us 9.22 us 8.62 us

with record types

Method Mean Error StdDev
AdlHub 456.8 us 5.09 us 4.76 us
AlligatorHub 487.0 us 3.65 us 3.24 us
EmaHub 436.2 us 3.14 us 2.94 us
RenkoHub 337.5 us 1.58 us 1.40 us
SmaHub 449.1 us 5.00 us 4.68 us

Though, interesting; when adding Ema back as struct it gets better; so it must be something else related to this revert, something as simple as the test quotes importer mods.

Method Mean Error StdDev
EmaHub 323.2 us 3.98 us 3.73 us

@DaveSkender
Copy link
Owner Author

DaveSkender commented Jul 9, 2024

With immutable record types and primary positional constructors. These are still 5-10x slower than series-based uses, so will continue to narrow the gap. These will always be slower for batches due to having more overhead to manage the memory cache.

Method Mean Error StdDev
AdlHub 377.6 us 5.03 us 4.70 us
AlligatorHub 408.2 us 5.33 us 4.98 us
EmaHub 350.1 us 1.91 us 1.70 us
RenkoHub 275.7 us 1.68 us 1.57 us
SmaHub 369.6 us 3.49 us 3.26 us

@DaveSkender
Copy link
Owner Author

With stacked streaming base class inheritence

Method Mean Error StdDev
AdlHub 365.08 us 4.388 us 4.105 us
AlligatorHub 362.74 us 4.755 us 4.448 us
EmaHub 346.38 us 5.462 us 5.109 us
QuoteHub 18.35 us 0.340 us 0.318 us
RenkoHub 275.52 us 2.467 us 2.187 us
SmaHub 358.27 us 4.560 us 4.042 us

@DaveSkender
Copy link
Owner Author

Method Mean Error StdDev
AdlHub 32.65 us 5.501 us 0.302 us
AlligatorHub 52.81 us 26.280 us 1.441 us
EmaHub 26.30 us 4.368 us 0.239 us
QuoteHub 13.71 us 1.932 us 0.106 us
QuotePartHub 28.47 us 6.524 us 0.358 us
RenkoHub 161.57 us 41.480 us 2.274 us
SmaHub 37.52 us 7.330 us 0.402 us

@DaveSkender DaveSkender changed the title test: Stack overflow scenarios, others feat: Restack stream base classes, refactor overflow scenarios, others Jul 15, 2024
@DaveSkender DaveSkender marked this pull request as ready for review July 15, 2024 10:56
@DaveSkender DaveSkender changed the title feat: Restack stream base classes, refactor overflow scenarios, others feat: Restack stream base classes, fix stack overflow scenarios Jul 15, 2024
@DaveSkender DaveSkender merged commit 639f6ed into v3-increments Jul 15, 2024
14 checks passed
@DaveSkender DaveSkender deleted the v3-increments-stackoverflow branch July 15, 2024 10:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant