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

Reducing Execution Time #188

Merged
merged 3 commits into from
Feb 4, 2022
Merged

Reducing Execution Time #188

merged 3 commits into from
Feb 4, 2022

Conversation

JacksonBurns
Copy link
Member

Using Python's built-in cProfile, I am going to identify some bottlenecks and hopefully remedy them.

@JacksonBurns
Copy link
Member Author

First fix (above) -- similarity_measure was calling sum on both descriptors to check if they had any active bits. According to the profiler, this was taking up a startling 94% of execution time.
initial_profile_result
Switching this call to run with np.any is 90% faster and removes this bottleneck.
profile_result

@JacksonBurns
Copy link
Member Author

Replacing flatten() with ravel() also sees a non-zero speed increase.
profile_result

@JacksonBurns
Copy link
Member Author

Using hasattr is slower than getattr (for the positive case, at least).
profile_result

@JacksonBurns
Copy link
Member Author

Remaining substantial time sinks are in basic handling of rdkit and numpy data -- the only way to effectively speed these up is to manipulate the native C objects, which is a task for molSim 2.0.0
Merging, and re-releasing as 1.0.0-rc.3 since this has significant speedup.

@JacksonBurns JacksonBurns merged commit 3ecf94f into master Feb 4, 2022
@JacksonBurns JacksonBurns deleted the speedup-dev branch February 4, 2022 04:57
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.

1 participant