XRENDERING-335: Improve cpu and memory footprint of XDOM generation from listener events