From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C38D47EF29 for ; Fri, 18 Dec 2015 09:19:30 +0100 (CET) IronPort-PHdr: 9a23:znSa2xxKoL3l2NHXCy+O+j09IxM/srCxBDY+r6Qd0e4RIJqq85mqBkHD//Il1AaPBtWFraocw8Pt8IneGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwudrqzQtaapv/0/t7x0qWbWx9Piju5bOE6BzSNhiKViPMrh5B/IL060BrDrygAUe1XwWR1OQDbxE6ktY/jtKJkpm5bsvclsspBSrnSfqIiTLUeAi5sezQ+7cjv8B3CVhen530GU2xQnAAeUCbf6xSvfJDrviL8/tU1jCudJ8HxT68cVjGr7qMtQxjt3nRUfwUl+X3a35QjxJlQpwis8kRy Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jordojw@gmail.com; spf=Pass smtp.mailfrom=jordojw@gmail.com; spf=None smtp.helo=postmaster@mail-lb0-f175.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jordojw@gmail.com) identity=pra; client-ip=209.85.217.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jordojw@gmail.com"; x-sender="jordojw@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jordojw@gmail.com designates 209.85.217.175 as permitted sender) identity=mailfrom; client-ip=209.85.217.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jordojw@gmail.com"; x-sender="jordojw@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lb0-f175.google.com) identity=helo; client-ip=209.85.217.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jordojw@gmail.com"; x-sender="postmaster@mail-lb0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BFAABZwHNWm6/ZVdFdhHkGsxmKT4Fihz4HOhIBAQEBAQEBARABAQEBAQYLCwkhIwuCLYF+IhEdARseAxIIAQc3AiQBEQEFASIbGod3AQMSm0GCCIExPjGLSIFqgnmIFwoZJw1Wg3oBBQ6TPYFJBY4tiFCBDIw8m1ASJIEXKQ6CVIF+HTSEagEBAQ X-IPAS-Result: A0BFAABZwHNWm6/ZVdFdhHkGsxmKT4Fihz4HOhIBAQEBAQEBARABAQEBAQYLCwkhIwuCLYF+IhEdARseAxIIAQc3AiQBEQEFASIbGod3AQMSm0GCCIExPjGLSIFqgnmIFwoZJw1Wg3oBBQ6TPYFJBY4tiFCBDIw8m1ASJIEXKQ6CVIF+HTSEagEBAQ X-IronPort-AV: E=Sophos;i="5.20,445,1444687200"; d="scan'208";a="192872740" Received: from mail-lb0-f175.google.com ([209.85.217.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 18 Dec 2015 09:19:30 +0100 Received: by mail-lb0-f175.google.com with SMTP id cs9so58892352lbb.1 for ; Fri, 18 Dec 2015 00:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=BhIPc652J4bJtKGyV/QSOFlbDcyxI8B5DflGz/neXZ8=; b=uDnNg5RNmxBuCZs6UpjGSozEggLsrjhLa6Sqah47vTK3ellbj+Ypf2jjfK1ca2HU63 4yeVSTFWYfzR1xg82hzuvOgYtCdh/H8pigQP+Qj1eLrfcJef2OnuMvTaWHxczHqcTGCW 2PRK6vfcrsjt05mLF71TiX8tK4UbuHlyrCXaraF/EQzENnpkdaJHUtWs97ibs2vv4zpl M2caztaXf2vbojfvz2L43U28PxWuLZqkkdqVtkBDtO5Po/bthCQot3hc8Gq0wWCh+Awj hmzucJnKzjvE891J8XzSZNSHMJVmmkTNeSzW6zHFY7obC4ozEugEm3zLkHzWNf7PVA8K 5Pog== MIME-Version: 1.0 X-Received: by 10.112.202.101 with SMTP id kh5mr808385lbc.66.1450426769235; Fri, 18 Dec 2015 00:19:29 -0800 (PST) Received: by 10.25.33.137 with HTTP; Fri, 18 Dec 2015 00:19:29 -0800 (PST) Date: Fri, 18 Dec 2015 00:19:29 -0800 Message-ID: From: Jordan W To: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a11c3724c5a683a052727cc1b X-Validation-by: jordojw@gmail.com Subject: [Caml-list] Just how slow are classes? --001a11c3724c5a683a052727cc1b Content-Type: text/plain; charset=UTF-8 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 --001a11c3724c5a683a052727cc1b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am aware of some of the reasons why OCaml classes and ob= jects are slower than records. The lack of nominal subtyping makes determin= ing memory layout at compile time much more difficult.

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

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

Jordan
--001a11c3724c5a683a052727cc1b--