improve performance in calc.dimVar