Skip to content

Coding - Small optimization of StepData_StepReaderData#543

Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi:step_data_opt
May 19, 2025
Merged

Coding - Small optimization of StepData_StepReaderData#543
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi:step_data_opt

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

Refactor SetEntityNumbers to use reusable memory pool.
Update SetRecord to avoid extra map searches.

Refactor SetEntityNumbers to use reusable memory pool.
Update SetRecord to avoid extra map searches.
@dpasukhi dpasukhi added this to the Release 8.0 milestone May 17, 2025
@dpasukhi dpasukhi requested a review from Copilot May 17, 2025 12:29
@dpasukhi dpasukhi self-assigned this May 17, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Coding Coding rules, trivial changes and misprints labels May 17, 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

Refactors entity number assignment to use a reusable memory pool allocator and streamlines type lookup.

  • Introduce NCollection_IncAllocator to back maps and sequences in SetEntityNumbers
  • Simplify SetRecord by replacing manual lookup with a direct thenametypes.Add call
  • Remove legacy comment blocks and unused lookup code
Comments suppressed due to low confidence (1)

src/DataExchange/TKDESTEP/StepData/StepData_StepReaderData.cxx:395

  • Calling thenametypes.Add unconditionally appends a new string each time, leading to duplicates. Consider checking if type already exists (e.g., Contains/FindIndex) and only add when absent, to preserve correct indices.
thetypes.ChangeValue(num) = thenametypes.Add(TCollection_AsciiString(type));

@dpasukhi dpasukhi requested a review from a team May 17, 2025 18:56
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 Todo to Integration in Maintenance May 19, 2025
@dpasukhi dpasukhi merged commit 973259d into Open-Cascade-SAS:IR May 19, 2025
33 checks passed
@dpasukhi dpasukhi deleted the step_data_opt branch May 19, 2025 11:07
@github-project-automation github-project-automation bot moved this from Integration to Done in Maintenance May 19, 2025
dpasukhi added a commit to dpasukhi/OCCT that referenced this pull request May 19, 2025
…AS#543

Refactor SetEntityNumbers to use reusable memory pool.
Update SetRecord to avoid extra map searches.
dpasukhi added a commit to dpasukhi/OCCT that referenced this pull request May 20, 2025
…AS#543

Refactor SetEntityNumbers to use reusable memory pool.
Update SetRecord to avoid extra map searches.
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 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants