Add inline attributes for performance optimization#35
Open
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #8
Implement inline initiative as requested in issue #8: - Add #[inline] to obvious functions like try_get_link - Add #[inline(always)] to hard delegation functions like constants(), count_links(), and Box trait implementations - Add #[cfg_attr(feature = "inline-more", inline)] to questionable/internal functions like is_unused, exists, get_total - Fix feature name from more-inline to inline-more in Cargo.toml - Update existing cfg_attr directives to use correct feature name 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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
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