Closed daico007 closed 1 year ago
@chrisiacovella, I kept the containment
intact, since it's still being used by the polymer.build
, and if it's false, the children is not being added anyway. The in-house OrderedSet
is kept since we are still using it in the lammpsdata.py
, and it's technically a modified OrderedSet
with some extra property.
Patch coverage: 100.00
% and project coverage change: -0.02
:warning:
Comparison is base (
87edc4a
) 87.15% compared to head (acabea0
) 87.13%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
PR Summary:
After the discussion with @chrisiacovella, we have decided it would be faster to store
Compound.children
withlist
instead of the in houseOrderedSet
. The replacement will speed up both theCompound.add
step by removing the comparing stage when adding new children to a set, and the indexing (getting element from a list/set by index). We realized the latter was the cause for https://github.com/mosdef-hub/mbuild/issues/1114, not directly theCompound.add_bond
itself, but how theparticle
is retrieved fromCompound.children
to perform the addition.PR Checklist