From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C33EC7FA5F for ; Thu, 19 Jan 2017 15:36:06 +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=3AiAaFXxy4AcyUOvzXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?2u4QIJqq85mqBkHD//Il1AaPBtSHra4dwLeG+4nbGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1?= =?us-ascii?q?Ov71GonPhMiryuy+4ZPebgFHiTanbr5+MRq6oAXSu8ILnYZsN6E9xwfTrHBVYe?= =?us-ascii?q?pW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH0169bwtRbf?= =?us-ascii?q?VwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXzmp8rxmQwH0hi?= =?us-ascii?q?gZKzE58XnXis1ug6JdvBKhvAF0z4rNbI2IKPZyYqbRcNUHTmRDQ8lRTTRMDJ6i?= =?us-ascii?q?YYsBD+QPPuhWoIfyqFQMsRSwChKhBP/txzJSmnP6waM33uYnHArb3AIgBdUOsH?= =?us-ascii?q?HModjpMKcdS+G1zK/VxjvDdfNW2Cz955TIchs8pvyDR7ZwftDQyUkpDQ/FgE+Q?= =?us-ascii?q?qY3+PzyJ1uQAqGyb4PRvVOKuhW4nqht9rSSoxscpk4TEgJ8exF7D9SV82ok1JN?= =?us-ascii?q?u4RVZ0Yd6lDJtQtzyaOJBsTsw+RGFovT42yrkYtp+0fSgKxpUnywTDZPyAdoiF?= =?us-ascii?q?5A/oWuWJITpgmX5oe7Kyiwyy/EWh0OHwSNW43VlQoidLktTArm0B2h/T58SdVP?= =?us-ascii?q?dw8F2t1DKR2wzJ9+1JLk85mKzGIJA72LEwjIAcsUHbEy/2hkr2iKiWe106+uiy?= =?us-ascii?q?7OTnf6nmq5GAO4NuigDxKKUvms2kDusiKAQOWXaU+fik2L3i+032XqlKg+Urnq?= =?us-ascii?q?TasJ3WP8QWq6+jDwNLzoou5AyzAjmm3dgAmHkINlNFeBaJj4jzPFHOJej1Au27?= =?us-ascii?q?g1u2kTdrwerKPrP7ApXMNXjMjLfhcK1560FCxwszzN5f55NOBr4dJ/LzX1f9tM?= =?us-ascii?q?bEAR8hLwy03+HnBc1h2YwEXGKPBraVMKfTsV+T+uIiOPKMZY8QuDblMfcp/f/u?= =?us-ascii?q?jXkjmV8cZ6alx5UXaGqgEvRjJEWWfGTjj88aEWcPogo+VOvqiECeUW0bW3Hnea?= =?us-ascii?q?M4/XkRBYmlAJ2LEoashKfH1iqwHZBMTmpHDUmRGHH0MZiCWrIMZSOeL8trnyYL?= =?us-ascii?q?E7SsHctpnxqnsQu/z7t8MsLV/DcZvNTtzpI9s+bakBV38T1vE+yc1XuMRid6hD?= =?us-ascii?q?VbaSUx2fVWpUV8zB+ty6ljiPwQQdVX7vJPFAkgNIXXz8R+BsDzVAOHddCMHgX1?= =?us-ascii?q?Cu66CC08G4pii+QFZFxwTpD71kjO?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CEAQB+zoBYhyPMOLleGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgxQBAQEBAX8DJ4QwinqREQ+XKSqFeAKCQRQ?= =?us-ascii?q?BAQEBAQEBAQEBARIBAQEKCwkKHTCCMxsBghoBAQEDASMVNAoICwsYAgImAgJXB?= =?us-ascii?q?gEMCAEBiHcMAQmvaYIlikABAQEHAQEBAQEBHQWBC4VAggWBYIEJh0+CXgEEm0S?= =?us-ascii?q?Be4RmiwSKMIY+inSHegI2gTgSHU+ETIFsilYBAQE?= X-IPAS-Result: =?us-ascii?q?A0CEAQB+zoBYhyPMOLleGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgxQBAQEBAX8DJ4QwinqREQ+XKSqFeAKCQRQBAQEBAQEBAQEBA?= =?us-ascii?q?RIBAQEKCwkKHTCCMxsBghoBAQEDASMVNAoICwsYAgImAgJXBgEMCAEBiHcMAQm?= =?us-ascii?q?vaYIlikABAQEHAQEBAQEBHQWBC4VAggWBYIEJh0+CXgEEm0SBe4RmiwSKMIY+i?= =?us-ascii?q?nSHegI2gTgSHU+ETIFsilYBAQE?= X-IronPort-AV: E=Sophos;i="5.33,254,1477954800"; d="scan'208";a="209965967" 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; 19 Jan 2017 15:35:43 +0100 Received: from mtaout10.int.yaziba.net (mtaout10.int.yaziba.net [10.4.20.36]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by vrout30.yaziba.net (mx10.yaziba.net) with ESMTPS id 3E9BB52877; Thu, 19 Jan 2017 15:35:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mtaout10.int.yaziba.net (Postfix) with ESMTP id 45D311601BF; Thu, 19 Jan 2017 15:35:42 +0100 (CET) X-Virus-Scanned: amavisd-new at Received: from mtaout10.int.yaziba.net ([127.0.0.1]) by localhost (mtaout10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Xznqpn2L4WyI; Thu, 19 Jan 2017 15:35:42 +0100 (CET) Received: from [10.0.210.135] (unknown [185.23.92.144]) by mtaout10.int.yaziba.net (Postfix) with ESMTPSA id 2AFDB160184; Thu, 19 Jan 2017 15:35:42 +0100 (CET) To: Nils Becker , "caml-list@inria.fr" References: <2B595CCC-1121-4C8C-8F5F-A235D3AB19BB@yahoo.com> <64e5fca1-a5da-9ff5-ad90-b23343d17360@bioquant.uni-heidelberg.de> From: Alain Frisch Message-ID: Date: Thu, 19 Jan 2017 15:35:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <64e5fca1-a5da-9ff5-ad90-b23343d17360@bioquant.uni-heidelberg.de> 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: gggruggvucftvghtrhhoucdtuddrfeelgedrgedugdeifecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptehlrghinhcuhfhrihhstghhuceorghlrghinhdrfhhrihhstghhsehlvgigihhfihdrtghomheqnecuffhomhgrihhnpehgihhthhhusgdrtghomhdplhgvgihifhhirdgtohhmnecukfhppedukeehrddvfedrledvrddugeegnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Ocaml optimizer pitfalls & work-arounds On 19/01/2017 12:20, Nils Becker wrote: > a while ago there was a proposal for deprecating the specialized > treatment of float arrays, which was not accepted iirc. For future reference, here are some relevant links: https://www.lexifi.com/blog/about-unboxed-float-arrays https://github.com/ocaml/ocaml/pull/163 https://github.com/ocaml/ocaml/pull/616 > it seems that > the slowdown of all Array.get calls is quite a high price to pay. what > do we gain from the float array specialization? (honest question - i > don't have a good understanding) As far as I understand, the main argument for keeping the special current hack is that it helps beginners writing naive numerical code get something not horribly inefficient, while most proponents of removing the hack are advanced users who feel that the current situation gets in the way towards very efficient code. Providing a FloatArray module would address parts of the concerns from these advanced users. At least it would allow better optimization of numerical code, and pave the way for a future deprecation/removal of the special hack. It would not address bad consequences of the special hack on (i) the performance of generic array accesses would remain and (ii) the complexity and corner cases in the compiler and runtime system. (Another argument in favor of the status quo is that writing "FloatArray.get a i" is syntactically heavier than "a.(i)". Interestingly, I don't feel that the ability to write polymorphic code on arrays and apply it to (unboxed) float arrays is considered as a very important property.) -- Alain