Opened 7 years ago
Closed 6 years ago
#1486 closed defect (fixed)
Ribbon slowing graphics enormously for large models
Reported by: | Tristan Croll | Owned by: | Greg Couch |
---|---|---|---|
Priority: | critical | Milestone: | 0.9 |
Component: | Graphics | Version: | |
Keywords: | Cc: | Tom Goddard | |
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
There is a bug in the ribbon code of structure.py
causing the number of tethers to blow out geometrically with the number of chains. Using 5wsg as an example, it slows down the "Spotlight mode" (which changes atom visibility, but doesn't directly change the ribbon drawing) in Clipper to around 0.5 fps under normal lighting (and framerate is under 30fps even doing nothing to the model in a freshly-opened session). If m
is the AtomicStructure
:
sum([len(t[3]) for t in m._ribbon_tether if t[3] is not None]) Out: 2437552
If I edit _create_ribbon_graphics()
in structure.py
:
from numpy.linalg import norm from .molarray import Atoms tether_atoms = Atoms(list(self._ribbon_spline_backbone.keys())) spline_coords = array(list(self._ribbon_spline_backbone.values())) > mask = tether_atoms.indices(atoms) > tether_atoms = tether_atoms[mask] > spline_coords = spline_coords[mask] if len(spline_coords) == 0: spline_coords = spline_coords.reshape((0,3))
... then performance returns to more expected levels (55 fps when standing still, ~12fps when scrolling around in Clipper spotlight mode vs. 30fps with ribbon turned off entirely). Ribbon tethers appear correct. Also:
sum([len(t[3]) for t in m._ribbon_tether if t[3] is not None]) Out: 1364
Change History (10)
comment:1 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 6 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This change broke tethers to nucleotides.
comment:4 by , 6 years ago
Milestone: | → 0.9 |
---|
comment:6 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | reopened → assigned |
comment:7 by , 6 years ago
Status: | assigned → feedback |
---|
I found this by looking in the log for changes that referred to tethers. I removed the patch, and then the nucleotide tethers started working again.
The intent of the patch to reduce the spline computations is good. So I've revised the patch to only do the computation for "visible" atoms.
Tristan, does the revised fix work for you?
comment:8 by , 6 years ago
Tristan, can you please confirm whether this change is acceptable for release 0.9?
follow-up: 9 comment:9 by , 6 years ago
Seems to be working fine - I haven’t noticed any problems since the change.
Added change in 028ed3a4e.