﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
3000	Show / hide slow on very large structures due to change tracking	Tom Goddard	Tom Goddard	"Show and hide commands for atoms on large structure such as 6q3g (1 million atoms) are sluggish due to atomic ChangeTracker (C++) accumulating all the modified atoms in a std::set.  These commands become 5 times faster (taking 0.16 seconds instead of 0.80 seconds) if the modified atoms are not accumulated.  The actual set of atoms modified are rarely needed by change trigger handlers.  So this 5x performance decrease is for no purpose.  Snappy performance on large structures is a selling point of ChimeraX so we should figure out how to optimize this.

I don't have a good idea for optimizing it.  I tried std::unordered_set for modified objects and it was ~30% slower.  std::vector would probably be much faster, but there could be tons of undesired duplicates.  Remarkably half the time is in creating the modified std::set and half is in clearing it.

Optimally  we would not even accumulate the modified atoms if no one is using them.  But I don't know how to achieve that.  Maybe client code has to actually request when registering that it wants modified atoms.  It could be a global request that effects all change tracking.  I should do a survey to see if any code at all looks at the modified atoms.

Maybe nicer would be to just mark modified atoms.  Then only collect them when a handler asks for them.  The mark could be an integer attribute of the C++ Atom class.  To avoid having to clear it after every change the integer marking value can be increased by 1 each time a ""clear"" is done.

"	enhancement	closed	moderate		Performance		fixed		Eric Pettersen				all	ChimeraX
