Major Performance Optimizations (Fixes #115) #116
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Ben,
First off, thanks for creating Esper! I'm a big fan of its clean API and focus on performance.
I was looking through the open issues and saw the discussion in #115 about get_components performance. It's a great point, and it inspired me to take a deeper look and see if I could implement that optimization while staying 100% within the "pure Python" rule.
This PR is the result of that exploration. It directly addresses the suggestion in that issue and adds a few other performance tweaks.
Here’s a quick rundown of the main improvements:
To back this up, I've expanded the benchmark.py script with a couple of new scenarios that specifically highlight these improvements. The new "Rare Component" benchmark really shows off the new query logic in action.
I've also updated the unit tests to pass and added a few new ones to cover the new mechanics. I did my best to keep the changes clean and true to the spirit of the project.
Would love to get your feedback on this when you have a moment. Happy to discuss any of the changes or make adjustments.
Thanks again for your work on Esper!