perf: lazily materialize signal inputs#14
Open
Votienduong2208 wants to merge 1 commit into
Open
Conversation
|
@Votienduong2208 is attempting to deploy a commit to the dragoon4002's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Contributor-side status check: this PR is mergeable. The visible failing Vercel status points to the repo-owner/team GitHub authorization URL, which appears to be the same repository-level Vercel authorization gate seen on the other bounty PRs rather than a code-specific failure. Local validation passed: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
price_historyand candle dictionaries insidecompute_strategy_signalmomentum,macd_signal,z_score, etc.price_historyfor pure OHLC strategies when they do not need itCloses #2
Why it is faster
Before this change, every signal tick eagerly did both:
list(price_history)List[Candle] -> List[dict]That happened even when the selected strategy only needed one of those inputs. With a candle cache present, common price-only strategies paid the full OHLC conversion cost every tick and then discarded it.
This PR wraps those conversions in small lazy helpers so each strategy path only pays for the input it actually uses.
Validation
Ad-hoc verification script (temporary
C:\Users\Admin\AppData\Local\Temp\hermes-verify-artic-signals-lazy.py, cleaned up after run):Additional checks:
Both passed.
Notes
This targets a distinct dispatcher-level allocation bottleneck from the other issue #2 submissions. It improves the common engine path where
self._candle_cacheis populated but the active strategy is price-history based.If selected for payout: USDC on Base address can be provided privately after acceptance.