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

fulfillment_requirement is order of magnitude slower in python bindings #9

Open
danny305 opened this issue Jun 29, 2021 · 3 comments
Open

Comments

@danny305
Copy link
Contributor

I am playing with your python bindings and have identified that the function call making the bindings much slower than the executable. https://github.com/krab1k/ChargeFW2/blob/bef336cfbc239c78acd7e47ad9bc476c99cca24e/src/python.cpp#L53

for pdb id 3vw0, the bindings take nearly 10 seconds to fulfill_requirements while in the executable it takes 1.3 milliseconds. This is nearly 4 orders of magnitudes slower.

I am creating a pipeline where I need to run thousands of proteins through chargefw2 and I am doing this in python so I need the bindings to be as fast as the executable.

Can you explain to me the reason why you put fulfill_requirements in the Molecule constructor and not in the charge calculation (where the method requirements are known)?

I want to refactor your bindings but first need to understand why you wrote them this way to begin with.

@danny305
Copy link
Contributor Author

Here is my timing code if you would like to see for yourself.
image

@krab1k
Copy link
Member

krab1k commented Jul 1, 2021

Well, there is a simple reason... ;-) I just needed some Python bindings quickly for one project in which I worked only with small molecules so I created something really simple for the task. You are absolutely right that this should be changed. I guess this will autoresolve after dealing with #8. So let's talk about the bindings there.

@danny305
Copy link
Contributor Author

danny305 commented Jul 2, 2021

I fixed the bindings for this. I will submit a PR to close this issue. I have yet to rethink the bindings. This is just a patch so the current bindings have the same performance as the executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants