Hi Sebastian,

On Mon, Sep 13, 2010 at 2:44 PM, Sebastian Wolf <[email protected]> wrote:
> When I profile my project I saw that the method
> org.openscience.cdk.AtomContainer.addAtom(IAtom) calls
> org.openscience.cdk.ChemObject.addListener(IChemObjectListener). In this
> method "contains" (java.util.ArrayList.contains(Object)) is called which
> needs so much time. (Screenshot attached)  Is it possible to avoid
> calling this method?

No, but I am working on a patch to fix this... I hope to submit this soon.

This patch will rework the NoNotificationChemobjectBuilder and
DefaultChemObjectBuilder such that the latter will extend the first,
instead of the first extending the latter as is now the case... this
involves setting up a new IModifiableChemObject interface, and rework
very many classes... (basically, all implementation code from
Atom.java has to go to NNAtom.java, etc.)

> I thought the NoNotificationChemobjectBuilder does not fire events?

No, in principle it doesn't... however, recently a bug in this area
was discovered, and the above patch is going to fix it.

> Or did I do something wrong in my source?

The code in your email looks OK to me...

Egon

-- 
Dr E.L. Willighagen
Post-doc @ Uppsala University (only until 2010-09-30)
Proteochemometrics / Bioclipse Group of Prof. Jarl Wikberg
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to