Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove findAll when matching ids #1994

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

AlexandruPopovici
Copy link
Contributor

Description & motivation

In FE2 when clicking on any of the items highlighted in the image below

finaAll1

Which would make all the objects of the selected type to become 'selected', for a large number of objects the main thread would get blocked for tens of seconds.

60% of the execution time was taken up by using findAll when going over very many string ids, to get the tree node from the viewer. In API 2.0, this is no longer needed. Instead you use findId which is incomparably faster since it's just one or two lookups. After making this change, the viewer overhead was completely gone. However there is still some FE2 related overhead, accounting for approx 30% of the total inital overhead.

I'm leaving two profiler recordings, one before the change, one after the change. The FE2 related overhead is visible in both, and it seems to be the same one mentioned here

Changes:

  • No more using findAll when trying to match object ids. Replaced with findId

To-do before merge:

Screenshots:

Before:
2024-01-26 (1)

After:
2024-01-26 (3)

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

Copy link
Contributor

@fabis94 fabis94 left a comment

Choose a reason for hiding this comment

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

I guess so? haha

@AlexandruPopovici AlexandruPopovici merged commit a55c185 into main Jan 26, 2024
10 of 21 checks passed
@AlexandruPopovici AlexandruPopovici deleted the alex/replace-find-all branch January 26, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants