caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven LUTHER <luther@dpt-info.u-strasbg.fr>
To: caml-list@inria.fr
Subject: Cost of polymorphic variants over normal ones.
Date: Thu, 11 Jan 2001 10:17:03 +0100	[thread overview]
Message-ID: <20010111101703.A3683@lambda.u-strasbg.fr> (raw)
In-Reply-To: <200101101825.NAA17093@labrador.eecs.harvard.edu>; from nr@eecs.harvard.edu on Wed, Jan 10, 2001 at 01:25:27PM -0500

On Wed, Jan 10, 2001 at 01:25:27PM -0500, Norman Ramsey wrote:
> We're designing interfaces for tools that will sometimes have to
> manipulate 32-bit integers, but will often be able to make do with the
> limited precision provided by the int type.  I would love to get some
> information about the relative cost of int vs nativeint in both
> parameter passing and datatype representation.
> 

A (somewhat) related question would be, what is the cost of polymorphic
variants compared to noarmal ones ?

The normal variants are coded as integers, and using them is fast, while
polymorphic variants use some kind of hash functionn, but very simple.

If i use a datatype that i will be pattern matching very often and i want it
to be quick, how much is the overhead of using polymorphic patterns over
noraml ones ?

Or did i misunderstand the way it works ?

Friendly,

Sven Luther



  reply	other threads:[~2001-01-11  9:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 18:25 questions about costs of nativeint vs int Norman Ramsey
2001-01-11  9:17 ` Sven LUTHER [this message]
2001-01-11 10:40   ` Cost of polymorphic variants over normal ones Alain Frisch
2001-01-11 10:44     ` Sven LUTHER
2001-01-11 14:50   ` Jacques Garrigue
2001-01-11 19:14     ` Markus Mottl
2001-01-11 18:34 ` questions about costs of nativeint vs int Xavier Leroy
2001-01-11 22:17   ` Norman Ramsey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010111101703.A3683@lambda.u-strasbg.fr \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).