Skip to content

Foundation Classes - Optimize NCollection_Array1 with type specific#608

Merged
dpasukhi merged 3 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:nc_array_impr
Jul 12, 2025
Merged

Foundation Classes - Optimize NCollection_Array1 with type specific#608
dpasukhi merged 3 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:nc_array_impr

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

Replaced parameterless construct() and destroy() methods with parameterized versions.
Update is_arithmetic checks to is_trivial to avoid extra iterations

Replaced parameterless construct() and destroy() methods with parameterized versions.
Update is_arithmetic checks to is_trivial to avoid extra iterations
@dpasukhi dpasukhi added this to the Release 8.0 milestone Jul 12, 2025
@dpasukhi dpasukhi requested a review from Copilot July 12, 2025 17:19
@dpasukhi dpasukhi self-assigned this Jul 12, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code labels Jul 12, 2025

This comment was marked as outdated.

@dpasukhi dpasukhi requested a review from Copilot July 12, 2025 18:43
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 optimizes the NCollection_Array1 class by replacing parameterless construct() and destroy() methods with parameterized versions and updating type trait checks from is_arithmetic to more precise trivial type checks. The changes aim to improve performance by avoiding unnecessary iterations and providing more accurate type-based optimizations.

  • Replaced parameterless construct() and destroy() methods with parameterized versions that specify ranges
  • Updated type trait checks from is_arithmetic to is_trivially_default_constructible and is_trivially_destructible
  • Removed redundant local variable anOldSize in the Resize method

Comment thread src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx
Comment thread src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx
Comment thread src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx
@dpasukhi dpasukhi merged commit 313630c into Open-Cascade-SAS:IR Jul 12, 2025
23 checks passed
@dpasukhi dpasukhi deleted the nc_array_impr branch July 12, 2025 19:05
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants