Skip to content
Update Performance and memory optimization authored by Iker Hurtado's avatar Iker Hurtado
......@@ -68,15 +68,7 @@ This requires a **more fine-grained structure change event**. The event needs so
All the single operations with atoms (change, removal and creation) could be done in a very efficient way if it wasn't for the **required recalculation of bonds**.
I've been **refactoring and testing the atom change operation** and it's the bonds recalculation what does the operation slow and memory demanding (temporarily, eventually the memory is freed).
How to skip the overall recalculation of bonds for every operation on atoms:
- atom change: I don't see an easy way. It requires to remove the current atom bonds (maybe going thru all of them looking for an end at the atom point) and generate new bonds (measuring the distance with the rest of atoms, O(n) operation). It doesn't sound as a efficient option but it could be tested.
- atom removal: It requires to remove the atom bonds (maybe going thru all of them looking for an end at the atom point)
- atom creation: It requires to generate bonds for the new atom (measuring the distance with the rest of atoms, O(n) operation)
Finally, we will wait **until the bonds refactoring**: the bonds will be part of the Structure model (instead of mere graphical objects), to fix this performance issue. That way, the solution will be easy and natural: the atoms and bonds will be referenced and will be easy to manipulate them.
## Structure representation and algorithms
......
......