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 0BD367F75C for ; Wed, 10 Sep 2014 14:39:17 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.192.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.192.45 as permitted sender) identity=mailfrom; client-ip=209.85.192.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@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-qg0-f45.google.com) identity=helo; client-ip=209.85.192.45; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-qg0-f45.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYBALdFEFTRVcAtm2dsb2JhbABZhDcEgnjPBwGBBggWEAEBAQEBBgsLCRQqhAMBAQEDARIRHQEbHQEDAQsGBQQBBg0qAgIiAREBBQEcBhMIGogLAQMJCJw2a4swgW0FgxCJDwoZJw1mhVMBEQEFDo8/B4J5gVMBBJxzkzwYKYUuIS+CTwEBAQ X-IPAS-Result: AuYBALdFEFTRVcAtm2dsb2JhbABZhDcEgnjPBwGBBggWEAEBAQEBBgsLCRQqhAMBAQEDARIRHQEbHQEDAQsGBQQBBg0qAgIiAREBBQEcBhMIGogLAQMJCJw2a4swgW0FgxCJDwoZJw1mhVMBEQEFDo8/B4J5gVMBBJxzkzwYKYUuIS+CTwEBAQ X-IronPort-AV: E=Sophos;i="5.04,499,1406584800"; d="scan'208";a="93952948" Received: from mail-qg0-f45.google.com ([209.85.192.45]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Sep 2014 14:39:16 +0200 Received: by mail-qg0-f45.google.com with SMTP id j107so5609163qga.4 for ; Wed, 10 Sep 2014 05:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=59Dic3VCmdW5d7ow34ahcvrhUlRC2Fy3vRF4EJv1m4w=; b=G3qk3IxpUvTccDAGpD6sWzSJ+1TLHN3h+yCXoR1sjKMH7Rdc3aYgb3qQ05Ba3WwVAX bfrlIAYFyWLNI5qxTyyOFsdY9D0COrgrSlwYzKAPeBjRAkaP+ePC3hm2H9YcRAbzZImm +sANFtpd54XqXgCKtvq3QMSv3fotguDGgmjUmRAjnVLi04YQIIgkvY17in6zbx0xxF9O 4WTdvVsUyr0rWPQa/iqRF0bLwGcOPTqTFkpxQDhoc4XmzNDBxbc1QonuOrbl185FzSpW WinG/o/SY/dRESjHeSiPvJAkq/fv95/i16UqtiQzzleW7IKsMQ8YtDD8Y+yLPKvv5ezG wGMg== X-Received: by 10.229.84.133 with SMTP id j5mr59771754qcl.14.1410352755724; Wed, 10 Sep 2014 05:39:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.174.68 with HTTP; Wed, 10 Sep 2014 05:38:55 -0700 (PDT) In-Reply-To: <20140910123749.GA23756@notk.org> References: <54101221.3010304@users.sourceforge.net> <1410348425.3003.11.camel@thinkpad> <1410351988.3003.19.camel@thinkpad> <20140910123749.GA23756@notk.org> From: Yotam Barnoy Date: Wed, 10 Sep 2014 08:38:55 -0400 Message-ID: To: Adrien Nader Cc: Gerd Stolpmann , SF Markus Elfring , Ocaml Mailing List Content-Type: multipart/alternative; boundary=001a113452560357a50502b5578b Subject: Re: [Caml-list] Clarification for the configuration of comparison functions --001a113452560357a50502b5578b Content-Type: text/plain; charset=UTF-8 That's good to know. Thanks for clarifying. Yotam On Wed, Sep 10, 2014 at 8:37 AM, Adrien Nader wrote: > 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 > --001a113452560357a50502b5578b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That's good to know. Thanks for clarifying.

Yotam

On Wed, Sep 10, 2014 at 8:37 AM, Adrien Nader &l= t;adrien@notk.org&= gt; wrote:
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 compariso= n
> > function drops you out into C (which has a cost)
>
> Don't think so. compare doesn't allocate memory, so the few ex= tra
> instructions in caml_c_call for making allocation available from C
> aren't required. Calling compare shouldn't be slower than call= ing 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

--001a113452560357a50502b5578b--