Skip to content

Coding, Data Exchange - Optimize entity graph evaluating#562

Merged
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:interface_graph_optimization
May 30, 2025
Merged

Coding, Data Exchange - Optimize entity graph evaluating#562
dpasukhi merged 6 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:interface_graph_optimization

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

Refactor Interface_Graph constructors for improved clarity.
Added memory pools to avoid fragmentation.
Added to reuse containers from iterators directly.

Refactor Interface_Graph constructors for improved clarity.
Added memory pools to avoid fragmentation.
Added to reuse containers from iterators directly.
@dpasukhi dpasukhi added this to the Release 7.9.2 milestone May 24, 2025
@dpasukhi dpasukhi requested a review from Copilot May 24, 2025 12:06
@dpasukhi dpasukhi self-assigned this May 24, 2025
@dpasukhi dpasukhi added the 2. Enhancement New feature or request label May 24, 2025
@dpasukhi dpasukhi added 1. Data Exchange Import/Export or iterating of the CAD data 1. Coding Coding rules, trivial changes and misprints labels May 24, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =

Comment thread src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pasukhin Dmitry <pasuhinsvzn@gmail.com>
@dpasukhi dpasukhi requested a review from Copilot May 24, 2025 12:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@dpasukhi dpasukhi requested a review from Copilot May 24, 2025 12:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_IncAllocator instances for sharings and temporary lists.
  • Simplify GetShareds and Shareds wrappers 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 anAlloc is vague—consider renaming it to something like sharingAllocator to clarify that it backs the main thesharings container.
Handle(NCollection_IncAllocator) anAlloc =

src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:164

  • [nitpick] The name anAlloc2 is non-descriptive—use tempAllocator or entityListAllocator to indicate its purpose in allocating temporary entity lists.
Handle(NCollection_IncAllocator) anAlloc2 =

src/DataExchange/TKXSBase/Interface/Interface_Graph.cxx:170

  • [nitpick] Identifier aListofEntities mixes casing conventions—rename to aListOfEntities to match PascalCase for multi-word identifiers.
Handle(TColStd_HSequenceOfTransient) aListofEntities = new TColStd_HSequenceOfTransient();

@dpasukhi dpasukhi requested a review from a team May 24, 2025 16:29
@dpasukhi dpasukhi moved this from Todo to Review in Maintenance May 29, 2025
@dpasukhi dpasukhi requested a review from ikochetkova May 30, 2025 09:14
Copy link
Copy Markdown
Contributor

@ikochetkova ikochetkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No remarks

@github-project-automation github-project-automation bot moved this from Review to Integration in Maintenance May 30, 2025
@dpasukhi dpasukhi merged commit 9ddcdae into Open-Cascade-SAS:IR May 30, 2025
66 of 68 checks passed
@dpasukhi dpasukhi deleted the interface_graph_optimization branch May 30, 2025 15:11
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance May 30, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Coding Coding rules, trivial changes and misprints 1. Data Exchange Import/Export or iterating of the CAD data 2. Enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants