caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nathaniel Gray" <n8gray@gmail.com>
To: "Jonathan Roewen" <jonathan.roewen@gmail.com>
Cc: "Edgar Friendly" <thelema314@gmail.com>,
	"Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Benchmarking different dispatch types
Date: Thu, 18 Jan 2007 15:57:56 -0800	[thread overview]
Message-ID: <aee06c9e0701181557oa5f5d36t5d2cbfbb5eef706e@mail.gmail.com> (raw)
In-Reply-To: <ad8cfe7e0701171903n70d05fb4ka68b2de6248c4713@mail.gmail.com>

On 1/17/07, Jonathan Roewen <jonathan.roewen@gmail.com> wrote:
> From what I understand, anything other than a function is bound to be
> fairly slow in comparison.

Sure, but I'm really interested in understanding the "penalty" for
using objects instead of, say, closures, and how much (if anything)
you get back by turning a method into a closure (as I did with the
obj. closure test).  It looks like there isn't much penalty, which
makes objects much more attractive to me for certain applications, and
there's not much gain to be had by "closurizing" method calls.

> For closures, you first have to build the closure from the
> environment, and then invoke it; and methods require some sort of
> lookup. Functions, on the other hand, are fairly simply: it's just a
> call to a known address (putting aside passing the actual arguments to
> the function/method call).

Well, for closures you don't need to build the closure at call-time,
that happens when it is created.

Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->


  reply	other threads:[~2007-01-18 23:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18  1:12 Nathaniel Gray
2007-01-18  2:17 ` [Caml-list] " Edgar Friendly
2007-01-18  3:03   ` Jonathan Roewen
2007-01-18 23:57     ` Nathaniel Gray [this message]
2007-01-18 15:52   ` Remi Vanicat
2007-01-18 22:33   ` Nathaniel Gray
2007-01-19  0:03     ` Robert Roessler
2007-01-31 17:03   ` Christophe TROESTLER
2007-01-18 16:56 ` William D. Neumann
2007-01-19  0:50 ` Jacques Garrigue
2007-01-19  8:30   ` Nathaniel Gray

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=aee06c9e0701181557oa5f5d36t5d2cbfbb5eef706e@mail.gmail.com \
    --to=n8gray@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jonathan.roewen@gmail.com \
    --cc=thelema314@gmail.com \
    /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).