Skip to content

Conversation

@germa89
Copy link
Collaborator

@germa89 germa89 commented Jan 23, 2025

Description

As the title. By using components instead of retrieving all entity ids, we speed up the process.

Previous implementation used XSEL functions to set the retrieved ids of the entities. While this was OK, it incurs in performance penalization because it has to write a file (sometimes quite big), transfer it and run it using non_interactive. Because of the amount of XSEL,A,... lines, this might posed a problem with the infamous gRPC instability (#3313).

I think the thorough testing should be sufficient to ensure we do not hit issues like #3372 or #2452
However can @mikerife have a look at the test_save_selection_2 code and see if I am missing something?

Benchmark

Testing code is test_save_selection_2.

# For 1 million elements
tmp_old.py -> Time spent: 1.423482750004041
tmp_old.py -> Time spent: 1.287161833999562
tmp_new.py -> Time spent: 0.10543733399754274
tmp_new.py -> Time spent: 0.11288025000612834

Issue linked

Close #3695

Checklist

@germa89 germa89 requested a review from a team as a code owner January 23, 2025 16:53
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@germa89 germa89 self-assigned this Jan 23, 2025
@github-actions github-actions bot added the new feature Request or proposal for a new feature label Jan 23, 2025
@codecov
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.09%. Comparing base (e6221a6) to head (6f13a54).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3697      +/-   ##
==========================================
- Coverage   87.14%   87.09%   -0.06%     
==========================================
  Files         187      187              
  Lines       14697    14709      +12     
==========================================
+ Hits        12808    12811       +3     
- Misses       1889     1898       +9     

@germa89
Copy link
Collaborator Author

germa89 commented Jan 24, 2025

@pyansys-ci-bot LGTM.

Copy link
Contributor

@pyansys-ci-bot pyansys-ci-bot left a comment

Choose a reason for hiding this comment

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

✅ Approving this PR because germa89 said so in here 😬

LGTM

@germa89 germa89 merged commit c8cdf67 into main Jan 24, 2025
49 of 50 checks passed
@germa89 germa89 deleted the feat/improving-save_selection-performance branch January 24, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Request or proposal for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

save_selection is very slow

3 participants