Caching node indexes and node count in local variables instead of calling getters each time reduces the method run time by factor of 1.5
Created attachment 132059 [details] Patch
For the WebKit/PerformanceTests/inspector/detailed-heapshots-smoke-test.html test with the patch applied: RESULT heap-snapshot: _buildDominatedNodes= 2857 ms without: RESULT heap-snapshot: _buildDominatedNodes= 4417 ms
Committed r110853: <http://trac.webkit.org/changeset/110853>