[performence] Speed up a bit something that takes alone about 12% of the time spend displaying the XE UI

(cherry picked from commit b28e7555341623d6a4c11506282c64d872d165f7)