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 A30C5800A3 for ; Wed, 21 Dec 2016 17:56:46 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mshinwell@janestreet.com; spf=Pass smtp.mailfrom=mshinwell@janestreet.com; spf=None smtp.helo=postmaster@mxout3.mail.janestreet.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mshinwell@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of mshinwell@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.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@mxout3.mail.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="postmaster@mxout3.mail.janestreet.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AEgckohI0Jk41aDbhPNmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgULv/xwZ3uMQTl6Ol3ixeRBMOAuqkC27Cd7P6oGTRZp83e4DZaKN0EfiRGoP?= =?us-ascii?q?tVtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blIt?= =?us-ascii?q?dazdU7TfhMWv1u2054abI0AR3GL8MoVJMQ6uoA7Nms4TiIpkYuZtm1qa6kdPLs?= =?us-ascii?q?tfz3lpKFbbpB3869295tY3/C1aofMs84hbWqX3ZakiZbNdBTUidWsy4Zu4mwPE?= =?us-ascii?q?SF6q72EfGl4WkxxXDgzBpEX/RZfwtDT3su5V2iCcMNbqV705RXKp6KI9G0ygsz?= =?us-ascii?q?sOKzNsqDKfscd3lq8O5U/4qg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A2AAAKs1pYfeXIaSZdGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBFAEBAQEBAQEBAQEBBwEBAQEBgwoBAQEBAXmBBweOPJVfgjSFQoR?= =?us-ascii?q?vijgqhXgCgVcHQhEBAQEBAQEBAQEBARIBAQsUCU2CMwQBFQWCFwEFIx0BARMXA?= =?us-ascii?q?gsBDwsLDQICCR0CAiEBEgEFAQoSBhMJCYg/AxcDC5wCP4saaIIogwwBAQWELwM?= =?us-ascii?q?KgzcBAQEBAQEBAQEBAQEBAQEBAQEBAQEVCBJ5hSuEWYJIgWgcgkALLYJdhxUMg?= =?us-ascii?q?UmRXTWGUoZwA4N0gkaOC4lshDiCSRQegRQ1gXkSA4NBgghyAYcIgU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0A2AAAKs1pYfeXIaSZdGQEBAQEBAQEBAQEBBwEBAQEBFAE?= =?us-ascii?q?BAQEBAQEBAQEBBwEBAQEBgwoBAQEBAXmBBweOPJVfgjSFQoRvijgqhXgCgVcHQ?= =?us-ascii?q?hEBAQEBAQEBAQEBARIBAQsUCU2CMwQBFQWCFwEFIx0BARMXAgsBDwsLDQICCR0?= =?us-ascii?q?CAiEBEgEFAQoSBhMJCYg/AxcDC5wCP4saaIIogwwBAQWELwMKgzcBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBAQEBAQEVCBJ5hSuEWYJIgWgcgkALLYJdhxUMgUmRXTWGUoZwA4N?= =?us-ascii?q?0gkaOC4lshDiCSRQegRQ1gXkSA4NBgghyAYcIgU8BAQE?= X-IronPort-AV: E=Sophos;i="5.33,384,1477954800"; d="scan'208";a="251066584" Received: from mxout3.mail.janestreet.com ([38.105.200.229]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2016 17:56:45 +0100 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout3.mail.janestreet.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cJkC4-0000ri-0O for caml-list@inria.fr; Wed, 21 Dec 2016 11:56:44 -0500 X-JS-Flow: external X-JS-Scanner-attachment: (ok) No attachments Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BYWrRK-AAAAGT-Z6; 2016-12-21 11:56:42.830615-05:00 Received: from mail-ua0-f198.google.com ([209.85.217.198]) by mxgoog1.mail.janestreet.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84_2) (envelope-from ) id 1cJkC2-0004Z6-PG for caml-list@inria.fr; Wed, 21 Dec 2016 11:56:42 -0500 Received: by mail-ua0-f198.google.com with SMTP id 2so123514070uax.4 for ; Wed, 21 Dec 2016 08:56:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=83t68OB4XHQbBO13z3QB+QaV4zSa5ShrMDACWhMGWtk=; b=LssS+kbQO+jodmz9zB3xpp+tO16Gs0kk7+Ks5hWCjucNV87A3ei82Pk+DUZDSt+DHQ c7RS8fAkFosJXGQTBCPk1L3uMhQbKfe7S715Cbid+EL2e2sDtTVz+h5Aq+KkUPmmxJdl 0aJWnA7I0DKcdxYHqSREdPD+ZBXY7GhEP7ij8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=83t68OB4XHQbBO13z3QB+QaV4zSa5ShrMDACWhMGWtk=; b=peyrF1EPfjDWG+dqodR5wvvU5+gXvBSHfNOFLb3/kCTGB/LGNi05TLZ0fJpfl/PAi0 5UBq0I5EXwJAyp9brVqWkugVa2uHddItJUf45j0NeZJ64lCLE/7ynF2n0gh8oarmy23+ Tt60HoH2sYw5CKp7c2w7ASHJCwlDQvLtY1gR96nDgujLEP8QQR7WGq4XsiiY3d87xfVy 0Mh8de7Yh3Aw8K35a0wFJZBo/PFB3VSOFUtjbqGLkKqs5FAuR7QKVMrOb+uF7QrNfx8A 3fBGK6Gv8qjSXa1vQK0/X7MreTT7w0gnKlF9h+t37lD2jXx1cQDS1SipRMQlUBXb61Jc XyZQ== X-Gm-Message-State: AIkVDXJV9kOOvhJSWko3Oz57gX5JlboyHzhRegLDWlR8Dj/1gK5vlaTqg6bYNHw6dMV1CxDvhA8YpOAsbdjxEv/npzp3u5SSSk8gFCZ6AX4lhY8L2BcM/s9ltOVsZzif/Kzyejam1TtOfXxmJL/q X-Received: by 10.176.67.99 with SMTP id k90mr4428247uak.61.1482339402430; Wed, 21 Dec 2016 08:56:42 -0800 (PST) X-Received: by 10.176.67.99 with SMTP id k90mr4428233uak.61.1482339402189; Wed, 21 Dec 2016 08:56:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.117.136 with HTTP; Wed, 21 Dec 2016 08:56:41 -0800 (PST) In-Reply-To: References: <7bc766a2-d460-524b-35ca-89609a34b719@tu-berlin.de> <1482148297.4629.19.camel@gerd-stolpmann.de> <0F7D3B1B3C4B894D824F5B822E3E5A172CFB9581@IRSMSX102.ger.corp.intel.com> <1482165686.4629.28.camel@gerd-stolpmann.de> <1506c421-618a-28d4-9a7b-7ba49baf47fa@lexifi.com> <45f9251b-c362-ac9f-fa71-07ab42087c90@lexifi.com> <1482337872.4629.108.camel@gerd-stolpmann.de> From:Mark Shinwell Date: Wed, 21 Dec 2016 16:56:41 +0000 Message-ID: To:Gabriel Scherer Cc:Yotam Barnoy , Gerd Stolpmann , Alain Frisch , =?UTF-8?B?RnLDqWTDqXJpYyBCb3Vy?= , "Soegtrop, Michael" , =?UTF-8?Q?Christoph_H=C3=B6ger?= , "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore X-Validation-by: mshinwell@janestreet.com Subject: Re: [Caml-list] Closing the performance gap to C I agree with Gabriel, but, we are planning substantial work within Flambda during the coming year to implement unboxing transformations therein. I do think we should spend a little time, before diving into this particular issue, convincing ourselves that these two tracks of work are going to be complementary rather than conflicting. Mark On 21 December 2016 at 16:47, Gabriel Scherer wrote: > I think there is an information asymmetry here. Alain has done a lot of work > on float unboxing in old and recent OCaml releases, and if he says that some > approach is a low-hanging fruit it is reasonable to trust him. I suspect, > Yotam, that you have different issues in mind that correspond to the fact > that inlining and specialization at the flambda level could be complementary > with the work that Alain is describing. > > (I think it is difficult to accurately discuss these optimization questions > at a high/conceptual level only.) > > On Wed, Dec 21, 2016 at 11:39 AM, Yotam Barnoy > wrote: >> >> On Wed, Dec 21, 2016 at 11:31 AM, Gerd Stolpmann >> wrote: >> > Dumb question because you are effectively suggesting an alternate >> > calling convention in addition to the existing one: wouldn't it make >> > more sense to switch to a completely different convention? Like: we >> > pass fp values always in fp registers so far available? >> > >> > >> > Gerd >> >> As far as I understand, the current calling convention has to do with >> generic functions. Having to be polymorphic over all types, including >> primitive ones, such as floating point and ints of different widths, >> is really difficult. This is why OOP languages don't do it -- only >> classes are polymorphic. >> >> And Alain, even if we create these alternate calling conventions, the >> tricky part is still detecting when it's ok to call using direct >> calling conventions. That's the hard part, and it's best done by >> Flambda with its inlining. >> >> -Yotam >> >> > >> > Am Mittwoch, den 21.12.2016, 17:06 +0100 schrieb Alain Frisch: >> >> On 21/12/2016 15:45, Yotam Barnoy wrote: >> >> > >> >> > I think it's not worth the effort. You need to examine all the code >> >> > dealing with a parameter (ie. its flow) to see if any generic >> >> > function >> >> > is called on that parameter. >> >> This would be treated a bit like the stubs for optional arguments >> >> with a >> >> default value. Any function taking float arguments or returning a >> >> float >> >> would be compiled to a specialized version with an unboxed calling >> >> convention plus a stub which implements the generic calling >> >> convention >> >> and delegate the call to the specialized version (or copy its body if >> >> it >> >> is small enough). On call site, when the called function is known, >> >> one >> >> calls the specialized version instead. This is a systematic, local >> >> compilation scheme, similar to other optimizations made in >> >> closure/cmmgen; it does not require a more global analysis nor a >> >> radically different representation of the code. >> >> >> >> About the "it's not worth the effort": the effort has largely been >> >> done, >> >> since the ticket came with a working patch (some more effort would >> >> be >> >> needed to bring it up to date, though). In my opinion, this seems >> >> like >> >> a rather low-hanging fruit with very immediate and significant >> >> gains. >> >> I'd rather have this soon than wait for flambda to become stable and >> >> usable on large projects. >> >> >> >> >> >> >> >> -- Alain >> >> >> > -- >> > ------------------------------------------------------------ >> > Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de >> > My OCaml site: http://www.camlcity.org >> > Contact details: http://www.camlcity.org/contact.html >> > Company homepage: http://www.gerd-stolpmann.de >> > ------------------------------------------------------------ >> > >> > >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs > >