caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* The performance cost of using exceptions?
@ 2000-05-13 21:59 Daniel Ortmann
  2000-05-15  7:31 ` Markus Mottl
  2000-05-16  9:55 ` Xavier Leroy
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Ortmann @ 2000-05-13 21:59 UTC (permalink / raw)
  To: caml-list

Are programs written to make heavy use of exceptions going to be markedly
slower than programs written more traditionally with loops/ifs, etc?

(My uninformed mental picture of exception is that they would use some type of
underlying setjump/longjump overhead.)

Thanks in advance to anyone who replies.

-- 
Daniel Ortmann, IBM Circuit Technology, Rochester, MN 55901-7829
ortmann@vnet.ibm.com or ortmann@us.ibm.com and 507.253.6795 (external)
ortmann@rchland.ibm.com and tieline 8.553.6795 (internal)
ortmann@isl.net and 507.288.7732 (home)

"The answers are so simple, and we all know where to look,
but it's easier just to avoid the question." -- Kansas



^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: The performance cost of using exceptions?
@ 2000-05-16 16:02 Dave Berry
  2000-05-16 17:13 ` Markus Mottl
  0 siblings, 1 reply; 9+ messages in thread
From: Dave Berry @ 2000-05-16 16:02 UTC (permalink / raw)
  To: Pierpaolo Bernardi, Frank Atanassow
  Cc: Markus Mottl, OCAML, Pierre.Weis, caml-redist

How about having a compiler that detects this pattern and emits the
necessary pointer comparisons?  Then you could write your code cleanly
(without exceptions, flags or comparisons), and the compiler can emit
whatever code is most efficient for its runtime.

Dave.


On Tue, 16 May 2000, Frank Atanassow wrote:
> Markus Mottl writes:
> the functional way would be to just return the subtree(s) intact, so there
would
> be no need to copy their spines.

For this to work, you should either have a low-level pointer equality
operator (present in OCaml, but not in other func. languages), or you
must return a flag to signal whether the returned tree is unchanged.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2000-05-17 17:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-13 21:59 The performance cost of using exceptions? Daniel Ortmann
2000-05-15  7:31 ` Markus Mottl
2000-05-16  9:30   ` Frank Atanassow
2000-05-16 13:45     ` Markus Mottl
2000-05-16 15:04     ` Pierpaolo Bernardi
2000-05-16 16:11       ` Jean-Francois Monin
2000-05-16  9:55 ` Xavier Leroy
2000-05-16 16:02 Dave Berry
2000-05-16 17:13 ` Markus Mottl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).