The big win here is using direct property accessors on node attributes rather than iteration. The rest is just micro-optimization.