ImageEngine/gaffer — pull request #859 by johnhaddon (2014-06-05 18:18:23+00:00)
Title: Optimised ComputeNode::hash().

The call to relativeName() was expensive because it was allocating memory. It's quicker to just iterate up the hierarchy ourselves and directly append each name we find along the way. I had tried optimising this in the past, but never got any measurements that confirmed a speedup. Now we've got much superior performance from temporary Contexts, the relativeName() cost comes through more clearly and there are obvious measurable benefits. A simple Constant->Reformat benchmark shows ~14% reduction in runtime, and a SceneReader benchmark shows a small but measurable improvement.

Also added some documentation for why the hash is computed the way it is.