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 0561B7F75C for ; Wed, 10 Sep 2014 14:37:51 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; 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@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgcFALdFEFRbeUeT/2dsb2JhbABZgw2DVlDLaIMfAYEOFniEBAEFI1YQCw4KAgIFEw4CAg8FGDGIWahNgW2TNAEXgSyOIQeCeTaBHQWccgGVLoNjO4J+AQEB X-IPAS-Result: AgcFALdFEFRbeUeT/2dsb2JhbABZgw2DVlDLaIMfAYEOFniEBAEFI1YQCw4KAgIFEw4CAg8FGDGIWahNgW2TNAEXgSyOIQeCeTaBHQWccgGVLoNjO4J+AQEB X-IronPort-AV: E=Sophos;i="5.04,499,1406584800"; d="scan'208";a="93952628" Received: from nautica.notk.org ([91.121.71.147]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 10 Sep 2014 14:37:50 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id A1226C009; Wed, 10 Sep 2014 14:37:49 +0200 (CEST) Date: Wed, 10 Sep 2014 14:37:49 +0200 From: Adrien Nader To: Gerd Stolpmann Cc: Yotam Barnoy , SF Markus Elfring , Ocaml Mailing List Message-ID: <20140910123749.GA23756@notk.org> References: <54101221.3010304@users.sourceforge.net> <1410348425.3003.11.camel@thinkpad> <1410351988.3003.19.camel@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1410351988.3003.19.camel@thinkpad> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Clarification for the configuration of comparison functions On Wed, Sep 10, 2014, Gerd Stolpmann wrote: > Am Mittwoch, den 10.09.2014, 08:07 -0400 schrieb Yotam Barnoy: > > Another reason is performance. The generic, polymorphic comparison > > function drops you out into C (which has a cost) > > Don't think so. compare doesn't allocate memory, so the few extra > instructions in caml_c_call for making allocation available from C > aren't required. Calling compare shouldn't be slower than calling a > function written in OCaml. And calling C from OCaml is _very_ fast. Too fast to be a concern. The other way round is slower, iirc maybe by a 100 factor. (you should benchmark yourself if any of these might be a concern) -- Adrien Nader