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 299057FA5E for ; Fri, 28 Apr 2017 17:21:13 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=octa@polychoron.fr; spf=Pass smtp.mailfrom=octa@polychoron.fr; spf=None smtp.helo=postmaster@relay2-d.mail.gandi.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of octa@polychoron.fr) identity=pra; client-ip=217.70.183.194; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="octa@polychoron.fr"; x-sender="octa@polychoron.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of octa@polychoron.fr designates 217.70.183.194 as permitted sender) identity=mailfrom; client-ip=217.70.183.194; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="octa@polychoron.fr"; x-sender="octa@polychoron.fr"; 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@relay2-d.mail.gandi.net) identity=helo; client-ip=217.70.183.194; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="octa@polychoron.fr"; x-sender="postmaster@relay2-d.mail.gandi.net"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AIsdsxh372tjZYh/JsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?se0SLfad9pjvdHbS+e9qxAeQG96Kt7Qc06L/iOPJYSQ4+5GPsXQPItRndiQuro?= =?us-ascii?q?EopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZv?= =?us-ascii?q?JuTyB4Xek9m72/q89pDXbAhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+?= =?us-ascii?q?VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfM?= =?us-ascii?q?QA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmlT?= =?us-ascii?q?kJNzA5/m/UhMJ/gq1UrxC9qBJw2IPUfIKYOeBicq/Bc94XR2xMVdtRWSxbBYO8?= =?us-ascii?q?apMCD+0dMuZEtYbyu1sOrQG5BQmqGejizThIiWPq3aIgyOkhCQbG3AggHt0SsH?= =?us-ascii?q?TUq8/1NKAUUeyvwqnI1yzOYvVL0jnz74jIdwouofCKXb9ocMrRz1MvFwLfgVmK?= =?us-ascii?q?p4zlJTWY3fkOvWiD9+dsS/+jhmw9pwxzvjSj3Nogh4rHi44P11zJ8Sp0zJ4xKN?= =?us-ascii?q?GmUkJ3fN6pHZhKuy2EOYZ7QdkuTmVqtSs817YIo4S0fDIQx5Qi3xPfa+KIc4yP?= =?us-ascii?q?4h/7TuaePzN4i2hleb6hnhq97FKsyujmWcm11FZGtCVFncPKtn8Q1hzf8M6HRe?= =?us-ascii?q?Vh/ku52DaP0R7c6v1cLEwqiKbWKYQtz7wsmpYJrEjOHSH7lF/rgKKSeUgo4u2o?= =?us-ascii?q?5P7mYrXiqJ+cLYh0igTmP6QphsO/Hf43PxMWX2ic/eS91KHs/U3+QLVQif02lL?= =?us-ascii?q?PVsJ7AJcgDvK62HxdV0po/6xa4FzqpzM4XnXwDLF5cfBKHjpPpO03VLfDjDfa/?= =?us-ascii?q?hkysny1xy/DHOL3hGJTNIWLZnLfvZ7Yuo3JbnQE6yNQa45NPFpkAJujyUwn/ro?= =?us-ascii?q?/2FBg8Zgu/3+/sCM960MtKXmmTC4eBN6fDul+P/OUpZeeWMtxG8A3hIuQosqa9?= =?us-ascii?q?xUQynkUQKPGk?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DoBAAQXQNZh8K3RtlEGh0BBQELARcBA?= =?us-ascii?q?QQBAQoBAYQLA4EJB4Nhm0WYHSyFeAKEMkMUAQEBAQEBAQEBAQESAQEBCA0JCCg?= =?us-ascii?q?vgjMggkMDAyMPAQVRCxoCJgICVxMIAQGKDhEKMa51giaLCQwhBYELhVOCCguCZ?= =?us-ascii?q?IMggguCOoJfBZ1RcIF+hC2NXYkRhmOUJwI2gStzEUSFAYFxcwGGXgGBDAEBAQ?= X-IPAS-Result: =?us-ascii?q?A0DoBAAQXQNZh8K3RtlEGh0BBQELARcBAQQBAQoBAYQLA4E?= =?us-ascii?q?JB4Nhm0WYHSyFeAKEMkMUAQEBAQEBAQEBAQESAQEBCA0JCCgvgjMggkMDAyMPA?= =?us-ascii?q?QVRCxoCJgICVxMIAQGKDhEKMa51giaLCQwhBYELhVOCCguCZIMggguCOoJfBZ1?= =?us-ascii?q?RcIF+hC2NXYkRhmOUJwI2gStzEUSFAYFxcwGGXgGBDAEBAQ?= X-IronPort-AV: E=Sophos;i="5.37,388,1488841200"; d="scan'208";a="270972852" Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 17:21:12 +0200 Received: from mfilter5-d.gandi.net (mfilter5-d.gandi.net [217.70.178.132]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id 5D5A8C5A8A for ; Fri, 28 Apr 2017 17:21:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter5-d.gandi.net Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter5-d.gandi.net (mfilter5-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id vJ7oq3Rtcfiq for ; Fri, 28 Apr 2017 17:21:11 +0200 (CEST) X-Originating-IP: 92.158.238.97 Received: from [192.168.1.18] (AMarseille-655-1-605-97.w92-158.abo.wanadoo.fr [92.158.238.97]) (Authenticated sender: octa@polychoron.fr) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id ED69AC5A6A for ; Fri, 28 Apr 2017 17:21:10 +0200 (CEST) To: caml-list@inria.fr References: <00fad276-cfec-0aca-9718-ae00a38f2437@gmail.com> From: octachron Message-ID: <503a12e7-09a4-b26f-7248-804ef5cffbcf@polychoron.fr> Date: Fri, 28 Apr 2017 17:21:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <00fad276-cfec-0aca-9718-ae00a38f2437@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [Caml-list] Performance degradation when using '=' instead of 'compare' The non-reflexivity of floating point equality is responsible for this problem. Since NaN ≠ NaN, (=) cannot use physical equality as a shortcut. For instance, with let x = [1, [0. /. 0.]] (x = x) is false, even if (x == x) is true. Compare is not subject to this semantic for floating point equality and can therefore use physical equality as a shortcut. See also https://caml.inria.fr/mantis/view.php?id=7502 for another instance of this problem in the context of cyclic data structure. — octachron.