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 F13D6800A3 for ; Wed, 21 Dec 2016 17:06:13 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=alain.frisch@lexifi.com; spf=None smtp.mailfrom=alain.frisch@lexifi.com; spf=None smtp.helo=postmaster@vrout30.yaziba.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=pra; client-ip=185.56.204.35; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=mailfrom; client-ip=185.56.204.35; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@vrout30.yaziba.net) identity=helo; client-ip=185.56.204.35; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="postmaster@vrout30.yaziba.net"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AU5tWfhU+bX1oTWp5maUVcn/Ep8nV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYbBaAt8tkgFKBZ4jH8fUM07OQ6PG7HzxaqsjR+Fk5M7V0Hycfjs?= =?us-ascii?q?sXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6?= =?us-ascii?q?KfroEYDOkcu3y/qy+5rOaAlUmTaxe71/IRG4oAnLtcQan4RuJ6cyxxDUvnZGZu?= =?us-ascii?q?NayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnD?= =?us-ascii?q?VhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0ji?= =?us-ascii?q?oMKiU0+3/LhMNukK1boQqhpx1hzI7SfIGVL+d1cqfEcd8HWWZNQsNdWipcCY2+?= =?us-ascii?q?coQPFfIMM/tGoYnzp1UArhWwCgejC+zt1jBGiWT73bE43uk7DQ3KwAItEtAIvX?= =?us-ascii?q?/JrNv1LqASUeWtwaTUyTXMdfJW2THg44bIaBAhoOqMUq5wccHMzkQgDQfFgU+R?= =?us-ascii?q?qYzjJT+V2P4Ns2mA7+V8VeKikGonpB9+oziuyMcsi5PFiZ4SylDB7Ch0xps+K9?= =?us-ascii?q?6gSENjfNKpE5tduzuaOoZ3WM8uXX1ktSkgxrAIuZO3ZDUGxZcnyhLFdfCKfZKE?= =?us-ascii?q?7xb9WOqLPDt1i31odbSijBio60eg0PfzVsys3VZKsCVFlt7Mu2gT1xzJ7ciHV+?= =?us-ascii?q?d980m91TqV1wHc8OBFIUEvmqXBMZIhxKA/loYLvUTCGC/5hln2gbeLekgn+uWk?= =?us-ascii?q?8eTqb7T8qpOCK4N5hRvyP6oul8CnBOQ3KAkOX2yV+eSm073j+FX0T69OjvIsk6?= =?us-ascii?q?nZtorWJcoBpq64GA9azoYj5g27Dzi439UYnHcHLFNfdB2biIjpPknCIOrkAven?= =?us-ascii?q?n1SsjDBryujaMbL7B5XNKmHPkLPgfbZm905R0xEzzNBa55JMEL4NOvPzWknrtN?= =?us-ascii?q?zZFBA1KQK0w/z/BNV40YMRRHyAD7eCMKPXrV+I/uUvI/SQZNxdhDGoGv857vum?= =?us-ascii?q?p3Yjn1gMNf242ocebXqxBPJhMm2WZHPthpEKFmJc7SQkS+m/oVmLUDgbSWyzRK?= =?us-ascii?q?k8rmUyDIunC8HNXIG2i7yp2CqrH5NXIGtBDwbfQj/Ta4yYVqJUO2qpKch7n2lB?= =?us-ascii?q?DOD5Rg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BAAACGp1pYhyPMOLldGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgn8LAQEBAQGQQ5VgDpcPhiICgiEQAQEBAQE?= =?us-ascii?q?BAQEBAQESAQEBCgsJCR0wgjMaAYIbAQUjFTQNEAsYAgImAgJXBg0IAQGIawGoY?= =?us-ascii?q?IIoiwcBAQEBBgEBAQEBAQEhgQuFK4F9glyEMIMUgl0BBJp3gXqPP4oihi+KP4N?= =?us-ascii?q?lhA0CNoEnUYN2gWmJSQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0BAAACGp1pYhyPMOLldGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgn8LAQEBAQGQQ5VgDpcPhiICgiEQAQEBAQEBAQEBAQESAQEBC?= =?us-ascii?q?gsJCR0wgjMaAYIbAQUjFTQNEAsYAgImAgJXBg0IAQGIawGoYIIoiwcBAQEBBgE?= =?us-ascii?q?BAQEBAQEhgQuFK4F9glyEMIMUgl0BBJp3gXqPP4oihi+KP4NlhA0CNoEnUYN2g?= =?us-ascii?q?WmJSQEBAQ?= X-IronPort-AV: E=Sophos;i="5.33,384,1477954800"; d="scan'208";a="205397833" Received: from vrout30-bl.yaziba.net (HELO vrout30.yaziba.net) ([185.56.204.35]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Dec 2016 17:06:13 +0100 Received: from mtaout20.int.yaziba.net (mtaout20.int.yaziba.net [10.4.20.37]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by vrout30.yaziba.net (mx10.yaziba.net) with ESMTPS id 4F90052187; Wed, 21 Dec 2016 17:06:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mtaout20.int.yaziba.net (Postfix) with ESMTP id 37B53160551; Wed, 21 Dec 2016 17:06:12 +0100 (CET) X-Virus-Scanned: amavisd-new at mtaout20.int.yaziba.net Received: from mtaout20.int.yaziba.net ([127.0.0.1]) by localhost (mtaout20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9qNrJYA2gmkt; Wed, 21 Dec 2016 17:06:12 +0100 (CET) Received: from [10.0.210.201] (unknown [185.23.92.144]) by mtaout20.int.yaziba.net (Postfix) with ESMTPSA id E68E0160427; Wed, 21 Dec 2016 17:06:11 +0100 (CET) To: Yotam Barnoy 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> Cc: =?UTF-8?B?RnLDqWTDqXJpYyBCb3Vy?= , Gerd Stolpmann , "Soegtrop, Michael" , =?UTF-8?Q?Christoph_H=c3=b6ger?= , "caml-list@inria.fr" From: Alain Frisch Message-ID: <45f9251b-c362-ac9f-fa71-07ab42087c90@lexifi.com> Date: Wed, 21 Dec 2016 17:06:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeelfedrkedvgdejgecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptehlrghinhcuhfhrihhstghhuceorghlrghinhdrfhhrihhstghhsehlvgigihhfihdrtghomheqnecukfhppedukeehrddvfedrledvrddugeegnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Closing the performance gap to C 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