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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 687857EF29 for ; Fri, 18 Dec 2015 12:13:23 +0100 (CET) IronPort-PHdr: 9a23:1HeXOx+9z+R0TP9uRHKM819IXTAuvvDOBiVQ1KB80OkcTK2v8tzYMVDF4r011RmSDduds6oMotGVmp6jcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47AblHf6ke/8SQVUk2mc1EleKKtQsb7tIee6aObw9XreQJGhT6wM/tZDS6dikHvjPQQmpZoMa0ryxHE8TNicuVSwn50dxrIx06vrpT4wJk23ClKt7oa68lESaDzeaJwGb1eAjMOPG0v6IjwqR7HVQ6G4H1aXmhA1lJqBBLJ5ReyYd+lsCzguu1/xwGVOMT3SfY/XjH0vJ1mUBv5tCBSGzcn8W2RtsF0iK9BiB+nvFl70onSJoaPO6lQZKTYKP8TW2tNFvxYVSdBD4W2ZoAPStYMOeJVtcGpi1IQrBf4OQSoAO714jJOnTryzKo8leM7HleVj0QbA9sSvSGM/53OP6AIXLXtwQ== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=David.Teller@ens-lyon.org; spf=None smtp.mailfrom=SRS0=Swmb=MT=ens-lyon.org=David.Teller@bounce.ens-lyon.org; spf=Pass smtp.helo=postmaster@sonata.ens-lyon.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of David.Teller@ens-lyon.org) identity=pra; client-ip=140.77.166.138; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="SRS0=Swmb=MT=ens-lyon.org=David.Teller@bounce.ens-lyon.org"; x-sender="David.Teller@ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of SRS0=Swmb=MT=ens-lyon.org=David.Teller@bounce.ens-lyon.org) identity=mailfrom; client-ip=140.77.166.138; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="SRS0=Swmb=MT=ens-lyon.org=David.Teller@bounce.ens-lyon.org"; x-sender="SRS0=Swmb=MT=ens-lyon.org=David.Teller@bounce.ens-lyon.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@sonata.ens-lyon.org designates 140.77.166.138 as permitted sender) identity=helo; client-ip=140.77.166.138; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="SRS0=Swmb=MT=ens-lyon.org=David.Teller@bounce.ens-lyon.org"; x-sender="postmaster@sonata.ens-lyon.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DUAQDZ6XNWnIqmTYxevXaKDoRMEAEBAQEBAQEBEAEBAQEBCAsJCSEugi2CBwEBAQMBcgYBEAsOCgkWDwkDAgECAUUGAQwIAQGIIwgEsiKLU4ZWhH6JQAEEln+GZKQIAjmCOx6BV4YCAQEB X-IPAS-Result: A0DUAQDZ6XNWnIqmTYxevXaKDoRMEAEBAQEBAQEBEAEBAQEBCAsJCSEugi2CBwEBAQMBcgYBEAsOCgkWDwkDAgECAUUGAQwIAQGIIwgEsiKLU4ZWhH6JQAEEln+GZKQIAjmCOx6BV4YCAQEB X-IronPort-AV: E=Sophos;i="5.20,445,1444687200"; d="scan'208";a="157579508" Received: from domu-toccata.ens-lyon.fr (HELO sonata.ens-lyon.org) ([140.77.166.138]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-GCM-SHA384; 18 Dec 2015 12:13:22 +0100 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 98DA2200C7; Fri, 18 Dec 2015 12:13:22 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AoLS7AOlu0w2; Fri, 18 Dec 2015 12:13:22 +0100 (CET) Received: from Bigorneau-Ninja.local (unknown [89.202.203.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 6D794200C6; Fri, 18 Dec 2015 12:13:22 +0100 (CET) Reply-To: David.Teller@ens-lyon.org References: <1450436817.23408.54.camel@e130.lan.sumadev.de> To: Gerd Stolpmann , Jordan W Cc: "caml-list@inria.fr" From: David Rajchenbach-Teller Message-ID: <5673EA51.7020904@ens-lyon.org> Date: Fri, 18 Dec 2015 12:13:21 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <1450436817.23408.54.camel@e130.lan.sumadev.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Just how slow are classes? On 18/12/15 12:06, Gerd Stolpmann wrote: > 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. As a side-note, JS JIT engines manage rather well in most common cases, despite the absence of inheritance. If my memory serves, JIT engines manage to compile simple lookups to essentially a simple array access (there's also need to check a tag, I don't remember if the tag is in a fat pointer or if it needs a dereference). > >> 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? > > It is essentially an additional hash table lookup. I thought that the OCaml compiler implemented inline caching in most common cases? Cheers, David