|
From: Geoffrey H. <ge...@ge...> - 2009-03-19 18:29:38
|
On Mar 19, 2009, at 10:25 AM, Craig A. James wrote: >> Frankly I don't really understand the code, but i see that it makes >> calls >> like IsAromatic(), CountRingBonds(), IsInRing(), KBOSum() etc. > ... > You may make small gains by storing more information about the > molecule, but the real problem with the SMARTS matcher is that it's > inherently slow, because of its design. Craig is correct, although I suspect you may also make some performance improvements by doing aromaticity detection and caching the results (i.e., which atoms and bonds are marked as aromatic). The remaining calls are fairly fast. And things like CountRingBonds() may not even be used by a given SMARTS. This is why we do lazy evaluation -- we want to be sure Open Babel does the minimum amount of perception. There's one other big performance improvement. Right now, the aromaticity detection calls FindSSSR (smallest set of smallest rings). This is unneeded. You can get constant time performance for aromaticity, which would help a lot on systems with many linked rings. (Nanotubes are a particularly painful example.) Hope that helps, -Geoff |