JSPerf test is way slower in all browsers, however, profiling shows 5x speed boost with flattening the DOM tree before processing.