Add inline attributes for performance optimization #35
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
This PR implements the inline initiative as requested in issue #8, adding
#[inline]attributes to optimize function inlining throughout the codebase.Changes Made
🔧 Feature Configuration
more-inlinetoinline-moreinCargo.tomlto match issue specificationcfg_attrdirectives to use the correct feature name⚡ Inline Attributes Added
#[inline]- Obvious functionstry_get_link()indata/traits.rs- Simple delegation that convertsOptiontoResult#[inline(always)]- Hard delegationsconstants()- All implementations that simply return&self.constantscount()- Simple delegation tocount_by([])Box<dyn Trait>implementations - Direct delegations to the boxed value:count_links()create_links()each_links()update_links()delete_links()get_link()#[cfg_attr(feature = "inline-more", inline)]- Questionable/internal functionsis_unused()- Internal function for checking unused links (both unit and split store)exists()- Internal function for existence checks (both unit and split store)get_total()/total()- Internal functions for getting total countsFiles Modified
doublets/Cargo.toml- Fixed feature namedoublets/src/data/traits.rs- Added inline attributes to trait methods and Box implementationsdoublets/src/mem/unit/store.rs- Added inline attributes to internal helper methodsdoublets/src/mem/split/store.rs- Added inline attributes to internal helper methodsTesting
The changes preserve all existing functionality while providing compiler hints for better inlining. The conditional
inline-morefeature allows users to opt into more aggressive inlining for performance-critical scenarios.Fixes #8
🤖 Generated with Claude Code