[Cython] CF and finally clause

Carl Witty carl.witty at gmail.com
Tue May 24 23:17:40 CEST 2011


On Tue, May 24, 2011 at 2:04 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> I'm not so opposed to this proposal. I have been (idly and unfoundedly)
> wondering basically forever if the current way try-finally is implemented is
> actually a good one. I can accept a performance penalty for the exception
> case in both try-finally and try-except, but the normal case in try-finally
> should run as fast as possible. I'm not sure the C compiler can always
> detect what that "normal" case is in order to properly optimise for it.

Evidently Java compilers duplicate the finally block (or, actually,
triplicate it):

http://cliffhacks.blogspot.com/2008/02/java-6-tryfinally-compilation-without.html

Carl


More information about the cython-devel mailing list