Apply #[inline]/[cold]/[never] per hot-path rules (#339)#376
Closed
joaquinbejar wants to merge 3 commits into
Closed
Apply #[inline]/[cold]/[never] per hot-path rules (#339)#376joaquinbejar wants to merge 3 commits into
joaquinbejar wants to merge 3 commits into
Conversation
Owner
joaquinbejar
commented
Apr 19, 2026
- refactor(attrs): apply #[inline] / #[cold]+#[inline(never)] per rules (Apply #[inline]/[always]/[never]/[cold] per hot-path and error-path rules #339)
- refactor(attrs): #[inline] on AdjustmentConfig builder chain
- refactor(attrs): extend #[inline] sweep to chains, metrics, delta_neutral
…#339) - `#[inline]` on hot-path public entry points and small accessors in `strategies/*`, `pnl/*`, `greeks/utils`, `pricing/{payoff,utils}`, `risk/span`, `volatility/utils`, etc. following the audit in `rules/global_rules.md` §Compiler Attributes. - `#[inline(never)]` on large / rarely-taken constructors such as `CustomStrategy::new` and other multi-arg builders that the optimiser has no business inlining. - `#[cold] #[inline(never)]` on every error constructor across `error/*` (`DecimalError::{overflow, arithmetic_error, conversion_error, out_of_bounds, invalid_precision, invalid_value}`, `PricingError::{method_error, simulation_error, invalid_engine, other, unsupported_option_type, non_finite}`, and the equivalents in `greeks`, `volatility`, `simulation`, `strategies`, `options`, `position`, `probability`, `chains`, `curves`, `surfaces`, `trade`) so panic / error paths don't pollute the inlining budget of the happy path. `#[inline(always)]` intentionally _not_ added here: the rules require a Criterion benchmark demonstrating the win first. That audit is tracked by the benchmark work on numeric kernels and will land in a follow-up PR. Closes #339
Owner
Author
|
@copilot review |
Reviewed the last 3 commits on this branch and ran baseline validation in this environment. No actionable issues were found in the inline/cold attribute changes, so no additional code changes were needed. Current head: Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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.