Skip to content

Performance improvements#10

Merged
Intuity merged 1 commit intomainfrom
optimisation
Feb 15, 2024
Merged

Performance improvements#10
Intuity merged 1 commit intomainfrom
optimisation

Conversation

@Intuity
Copy link
Copy Markdown
Owner

@Intuity Intuity commented Feb 15, 2024

Through profiling it was confirmed that the way unions were implemented (by broadcasting changes through _pt_updated) was very inefficient. This PR moves to backing all Packtype objects with a BitVector object that handles the data storage and bit extraction/alteration.

In simulations a 10x speedup was achieved from these changes.

This work also introduces a Base._pt_enable_profiling() method that prints out a report of the number of objects created at the end of the run, this can be helpful when debugging performance issues.

@Intuity Intuity requested a review from Alldred February 15, 2024 15:21
Copy link
Copy Markdown
Collaborator

@OisinRobinson OisinRobinson left a comment

Choose a reason for hiding this comment

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

I think that looks ok. I cannot see anything glaring that will cause issues.

Copy link
Copy Markdown
Collaborator

@OisinRobinson OisinRobinson left a comment

Choose a reason for hiding this comment

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

Adding approval

@Intuity Intuity merged commit 409d267 into main Feb 15, 2024
@Intuity Intuity deleted the optimisation branch February 15, 2024 16:10
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.

2 participants