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 0E4FE7FC07 for ; Fri, 18 Dec 2015 12:19:28 +0100 (CET) IronPort-PHdr: 9a23:CdYnVxCNRnFXnCwFNbMzUyQJP3N1i/DPJgcQr6AfoPdwSP75psbcNUDSrc9gkEXOFd2CrakU1ayO6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6MyZzvn8mJuLTtICxwzAKnZr1zKBjk5S7wjeIxxbVYF6Aq1xHSqWFJcekFjUlhJFaUggqurpzopM0roGxsvKcq/stEFKH7ZLgQTLpCDT1gPXpmytfssEznQAzH2XsdTmhexh5FBCDB9A6gA9H3vzes5bk14zWTIcCjFeN8Yj+l9ao+EBI= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=leo@lpw25.net; spf=None smtp.mailfrom=leo@lpw25.net; spf=None smtp.helo=postmaster@out1-smtp.messagingengine.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=pra; client-ip=66.111.4.25; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of leo@lpw25.net) identity=mailfrom; client-ip=66.111.4.25; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="leo@lpw25.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@out1-smtp.messagingengine.com) identity=helo; client-ip=66.111.4.25; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="leo@lpw25.net"; x-sender="postmaster@out1-smtp.messagingengine.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CHAADL6nNWmxkEb0JeFoN2bbh9hlQXCoVsAoE7PBABAQEBAQEBARABAQEBAQYLCwkhLoItgggBAQIBAUAyCA8LRiwriEAIDqpJhVqNEgEBAQcBAQEBARgGi1SFJ4IWDEEcgRqOM4hRhmSkCjmCUoF7IDQBhRABAQE X-IPAS-Result: A0CHAADL6nNWmxkEb0JeFoN2bbh9hlQXCoVsAoE7PBABAQEBAQEBARABAQEBAQYLCwkhLoItgggBAQIBAUAyCA8LRiwriEAIDqpJhVqNEgEBAQcBAQEBARgGi1SFJ4IWDEEcgRqOM4hRhmSkCjmCUoF7IDQBhRABAQE X-IronPort-AV: E=Sophos;i="5.20,445,1444687200"; d="scan'208";a="192921277" Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2015 12:19:27 +0100 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C8CAC2064F for ; Fri, 18 Dec 2015 06:19:24 -0500 (EST) Received: from web3 ([10.202.2.213]) by compute6.internal (MEProxy); Fri, 18 Dec 2015 06:19:24 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=lpw25.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=a6mCql/hG5oS0QD0dBJazIKbBB4=; b=PE3BSM Evb+Qbs5NEFwFXlm4/V6l/GZswsjbO+DYhWapg5TIYpNWQ2VtGlS4aI8+sWEI3LN xaRP+wCeAeI/L/JvIGttk65CV5SAoGkoVLFJ65NH3u2rP3lkY0HEe+bqpVxZdIdX pWXTR0/t2oI5HAUdyaUnp15OiSujUSNsry2kQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=a6mCql/hG5oS0QD 0dBJazIKbBB4=; b=bbDz5EB6dxb/PYVG2n+vTzDG2yvZKSLEIpImPNxMy5ACfWm NuIrgrSJUZYQ9YGn0BLYOTi4UtVNZZ62Oha82H4dA3NIgC4TjceKs1PxjpHrO7jY LAZRYCD4iGIjA7OYCg2kl2Tsp7GLDfgxCpNXJsC3KyxitMRwaY3NF9i5kuVw= Received: by web3.nyi.internal (Postfix, from userid 99) id 98E6D10F9A1; Fri, 18 Dec 2015 06:19:24 -0500 (EST) Message-Id: <1450437564.2699612.470934465.2C17EF54@webmail.messagingengine.com> X-Sasl-Enc: U5lyqpP4lQpfryKthsIzBqG0Nw80pEEol6eScMdXsGg2 1450437564 From: Leo White To: caml-list@inria.fr MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-a93c17cb Date: Fri, 18 Dec 2015 06:19:24 -0500 In-Reply-To: <1450436817.23408.54.camel@e130.lan.sumadev.de> References: <1450436817.23408.54.camel@e130.lan.sumadev.de> Subject: Re: [Caml-list] Just how slow are classes? > > 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. > > Oh, this is quickly explained. There is no hierarchy at runtime you can > exploit. Remember that object X can be a subtype of object Y even if > there is no inheritance relationship. This is very different from other > OO languages. > It is worth noting that you get similar issues with things like Java interfaces (you can think of every method in an OCaml object type as a Java interface containing a single method), and there are some effective mechanisms for optimising them. The most important of these is inline method caching, which is implemented for OCaml objects. Others, such as perfect hashing[1] are not implemented for OCaml, so there is probably room for improvement, but they would require significant amounts of work. Regards, Leo [1] http://www.lirmm.fr/~ducour/Publis/RD-TOPLAS-08.pdf