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

Improve performance by 2x and add a basic benchmark test #159

Merged
merged 63 commits into from
Aug 28, 2024
Merged

Conversation

tonybaloney
Copy link
Owner

@tonybaloney tonybaloney commented Aug 23, 2024

This pull request includes several changes aimed at improving the codebase by simplifying methods, optimizing performance, and enhancing readability. The most important changes include refactoring type conversion methods, modifying internal API functions, and optimizing dictionary and list handling.

Refactoring type conversion methods:

Modifying internal API functions:

Optimizing dictionary and list handling:

These changes collectively improve the efficiency and readability of the codebase, making it easier to maintain and extend in the future.

Anthony Shaw and others added 10 commits August 22, 2024 15:26
Previously the Tuple check was done after we'd done all the other 'is it a generic type' checks and that resulted in walking a long recursion depth of the Tuple interface list because Tuple didn't match any known generics. But since it is assignable to a non-generic interface, we can do the test a lot earlier, in fact even before we worry about generics, and this removes 12s on a profiler run or 14.44% of execution time to 0.29%
…ed LINQ eval

Callined .ToArray on the IEnumerable will force it to evaluate in place, whereas if we don't do that, it will not evaluate the iterator until later on (or possibly never). But this means we can't dispose of the PyObject instances in the tupleValues collection, because we don't know when they'll be evaluated. Instead, leave it to the GC to deref them
@tonybaloney tonybaloney changed the title Add an app for performance profiling Improve performance and add a basic benchmark test Aug 23, 2024
@tonybaloney tonybaloney marked this pull request as ready for review August 23, 2024 05:36
This reverts commit 165d7b0.
tonybaloney and others added 24 commits August 25, 2024 15:34
@tonybaloney tonybaloney changed the title Improve performance and add a basic benchmark test Improve performance by 2x and add a basic benchmark test Aug 28, 2024
@tonybaloney tonybaloney merged commit 4090d5b into main Aug 28, 2024
27 checks passed
@tonybaloney tonybaloney deleted the profile_app branch August 28, 2024 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants