Improve heatmap rendering performance when zsmooth is set to false [#6574], with thanks to @lvlte for the contribution!