ChargeFW2 icon indicating copy to clipboard operation
ChargeFW2 copied to clipboard

fulfillment_requirement is order of magnitude slower in python bindings

Open danny305 opened this issue 4 years ago • 3 comments

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 avatar Jun 29 '21 22:06 danny305

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

danny305 avatar Jun 29 '21 22:06 danny305

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.

krab1k avatar Jul 01 '21 16:07 krab1k

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.

danny305 avatar Jul 02 '21 15:07 danny305