
After much digging, it turns out that the slowdown occurs when the PDBio wrapper returns the new molecules to chimera. Due to wrappy's C++/Python reference count caching, the molecule's attributes are fetched at that time, and one of those attributes, sortedAtoms, takes a long time to compute (for 4371 atoms it takes 4.1 seconds on socrates, 3.2 on spin and 5.9 on my home P4). With a timing script, we can see that sortedAtoms isn't any slower in the lastest chimera, and sortedAtoms has been an attribute since 2000/05/02, so an optimization to speed up the initial sorting of atoms seems to have been lost recently. So far, I have been unable to find it, so I'm hoping Eric or Conrad will chime in. In the mean time, making sortedAtoms a member function instead of an attribute (which wrappy much prefers anyway) avoids the delay. Luckily no .py file in /usr/local/src/chimera calls sortedAtoms, so it is a fairly safe fix. - Greg