Coding, Data Exchange - Optimize entity graph evaluating#562
Merged
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom May 30, 2025
Merged
Coding, Data Exchange - Optimize entity graph evaluating#562dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
Conversation
Refactor Interface_Graph constructors for improved clarity. Added memory pools to avoid fragmentation. Added to reuse containers from iterators directly.
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Interface_Graph constructors to improve clarity, incorporates memory pools to avoid fragmentation, and reuses containers from iterators directly.
- Updated the Evaluate() function to integrate memory pool usage and streamline the evaluation loop.
- Simplified shared entity retrieval in GetShareds() and Sharings().
- Added necessary include for NCollection_IncAllocator to support memory pooling.
Comments suppressed due to low confidence (1)
src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:164
- [nitpick] Consider renaming 'anAlloc2' to something more descriptive (e.g., 'sharedListAllocator') to enhance code readability.
Handle(NCollection_IncAllocator) anAlloc2 =
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pasukhin Dmitry <pasuhinsvzn@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Interface_Graph evaluation logic to improve clarity and reduce memory fragmentation by introducing memory pools, and streamlines iterator-based container reuse.
- Replace raw list allocations with pooled allocators in
Evaluate. - Add two
NCollection_IncAllocatorinstances for sharings and temporary lists. - Simplify
GetSharedsandSharedswrappers to return container contents directly.
Comments suppressed due to low confidence (4)
src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:138
- Add a Doxygen-style comment above
Evaluate()to describe its purpose, parameters (if any), and side effects, especially the use of memory pools for list management.
void Interface_Graph::Evaluate()
src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:145
- [nitpick] The variable name
anAllocis vague—consider renaming it to something likesharingAllocatorto clarify that it backs the mainthesharingscontainer.
Handle(NCollection_IncAllocator) anAlloc =
src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:164
- [nitpick] The name
anAlloc2is non-descriptive—usetempAllocatororentityListAllocatorto indicate its purpose in allocating temporary entity lists.
Handle(NCollection_IncAllocator) anAlloc2 =
src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:170
- [nitpick] Identifier
aListofEntitiesmixes casing conventions—rename toaListOfEntitiesto match PascalCase for multi-word identifiers.
Handle(TColStd_HSequenceOfTransient) aListofEntities = new TColStd_HSequenceOfTransient();
dpasukhi
added a commit
that referenced
this pull request
Sep 6, 2025
Updated the Evaluate() function to integrate memory pool usage and streamline the evaluation loop. Simplified shared entity retrieval in GetShareds() and Sharings(). Added necessary include for NCollection_IncAllocator to support memory pooling.
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.
Refactor Interface_Graph constructors for improved clarity.
Added memory pools to avoid fragmentation.
Added to reuse containers from iterators directly.