I took the exception approach in a camlp4 macro: pa_breakcont

http://code.google.com/p/ocaml-break-continue/

There are timings before/after on the wiki section of that page that demonstrate the overhead.

Also, pa_breakcont changes rather than adds to the grammar increasing likelihood of conflict with other extensions. 

Hopefully, Sanghyeon can fix both of these drawbacks with his approach.

-Andy

 
On Thu, Apr 10, 2008 at 04:12:49PM +0200, David Allsopp wrote:
> Is there therefore any reasonable performance gain over implementing
> break/continue as a camlp4 extension rather than as a compiler patch?

The posted patch turns the break/continue into jump instructions
(well, jump bytecodes), which should be moderately faster than pushing
an exception stack frame / unwinding the stack.

Rich.

--
Richard Jones
Red Hat




--
Andrew I. Schein


web: www.andrewschein.com