optimized internal dom representation diffing