perf: create and clear Map in performance code