caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jordan W <jordojw@gmail.com>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] Just how slow are classes?
Date: Fri, 18 Dec 2015 00:19:29 -0800	[thread overview]
Message-ID: <CAPOA5_6cY1EQTYWJb6wMqJqBJsfLm9zgtfESrUBEZ1VtkCWmAg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

I am aware of some of the reasons why OCaml classes and objects are slower
than records. The lack of nominal subtyping makes determining memory layout
at compile time much more difficult.

While I am also curious why "nice cases" of objects/classes couldn't be
optimized (perhaps some link time check), when most of the objects adhere
to a nice hierarchy, I would like to defer that discussion until another
time. For now, my primary question is: Just *how* slow are objects/classes?
Has there been any relevant benchmarking efforts that could shed some light
on this?

For example, how much more expensive in terms of memory are objects
(compared to records). How much slower are property accesses and method
invocations than record accesses and module function invocations?

Jordan

[-- Attachment #2: Type: text/html, Size: 892 bytes --]

             reply	other threads:[~2015-12-18  8:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18  8:19 Jordan W [this message]
2015-12-18 11:06 ` Gerd Stolpmann
2015-12-18 11:13   ` David Rajchenbach-Teller
2015-12-18 11:19   ` Leo White

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=CAPOA5_6cY1EQTYWJb6wMqJqBJsfLm9zgtfESrUBEZ1VtkCWmAg@mail.gmail.com \
    --to=jordojw@gmail.com \
    --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).