If you're trying to maximize performance over a longer effort, it's best to pedal through the top so that you're at least getting quickly to the descent. A small amount of extra effort can save a lot of time, compared with coasting as early as possible and sllloooowwww-accelerating your way into the descent.
If I'm going for the Strava KOM on the ascent, or if it's a race with the finish line at the top... who cares.
If the reason you're asking the question is because you're bottoming out your gearing on the climb, and if this happens frequently, consider lower gearing.