Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] break and continue for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-11 (03:44)
From: Andrew I. Schein <andrew@a...>
Subject: Re: [Caml-list] break and continue for OCaml
I took the exception approach in a camlp4 macro: pa_breakcont

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.


> 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