canvas optimization on initialization