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 21D9C7FA5E for ; Fri, 28 Apr 2017 16:36:25 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=modlfo@gmail.com; spf=Pass smtp.mailfrom=modlfo@gmail.com; spf=None smtp.helo=postmaster@mail-it0-f54.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of modlfo@gmail.com) identity=pra; client-ip=209.85.214.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="modlfo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of modlfo@gmail.com designates 209.85.214.54 as permitted sender) identity=mailfrom; client-ip=209.85.214.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="modlfo@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-it0-f54.google.com) identity=helo; client-ip=209.85.214.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="postmaster@mail-it0-f54.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AuEWrthTY4yWFIBEoQ4NBIUIhltpsv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa69ZhyN2/xhgRfzUJnB7Loc0qyN4vymATRIyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+?= =?us-ascii?q?KPjrFY7OlcS30P2594HObwlSijewZbx/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf?= =?us-ascii?q?5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbD?= =?us-ascii?q?VwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlS?= =?us-ascii?q?gHLSY0/n/XhMJtj6xVrhyuqBNjzIDbe4yVKPhzc7nBcd8GS2dMXMBcXDFBDIOm?= =?us-ascii?q?aIsPCvIMM+BGoIn6oVsBtwG+ChSrBOjyzDFHnHD23bA80+s7DArIwBEgH9MPsX?= =?us-ascii?q?/Jq9j1MaASXv2xzKnGyjXOdPxW2TLn54jJdhAtu+2DXbV1ccfIz0QkCgDLjk2I?= =?us-ascii?q?pID7Iz+Y0v4Bvmub4uZ6S+6jlmEqpxtxrzWg3sshjobEipgIxl3K9Ch12oI4Kc?= =?us-ascii?q?OiREJlf9KoDp1dvDyAOYRsWMMtWWRotT46yrIYvZ67ezAHyJE9yB7eb/yLaomI?= =?us-ascii?q?4g7/WOqILzd1hH1odKiwhxa19kigxen8Wdeu3FlWqSpFl8HAtnEL1xPN9siKUu?= =?us-ascii?q?Vx8lul1DqV1A3e6vtILV4pmafUMZIswrE9moIWsUvZHy/2nEv2jLWRdkUh4uWo?= =?us-ascii?q?7uPnbajipp+SMI95kQ7+MqE0lcy+BeQ0KBQBX2+e+eikzr3s4VX5QKlWjv0xiq?= =?us-ascii?q?TWrIrVJcEfpqKgBw9V050j6wqkAje90NUYmGEHI0hfdBKGiYjpIVDOL+riAfex?= =?us-ascii?q?mVT/2AtskvvPO7mkBpTWMlDClq3gdPBz8R1y0g02mPRS4JRdEL0GaNb6VVL3vZ?= =?us-ascii?q?TiEx4re1ixxOrjBtJV2YYXWGbJCaicZvCB+WSU7/4idrHfLLQevyzwfqAo?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DvCACXUgNZfzbWVdFeHQEFAQsBGAEFA?= =?us-ascii?q?QsBhReDaJo7BoEFiTKOaw6KSEQTAQEBAQEBAQEBAQESAQEJCwsIJjGCMyCCbBU?= =?us-ascii?q?IARseAxIQDwImAiURAQUBLwgBAYoCAQMIDQSfFoNFP4wIggQFARyDCgWDXAoZJ?= =?us-ascii?q?w1WgnEqAgYJAQh5hQ6CTwuID4I6gl8FnVGBW5EzimsQhmOSYTOBFTeBKi4gCBk?= =?us-ascii?q?VXYRJghBzh2wBAQE?= X-IPAS-Result: =?us-ascii?q?A0DvCACXUgNZfzbWVdFeHQEFAQsBGAEFAQsBhReDaJo7BoE?= =?us-ascii?q?FiTKOaw6KSEQTAQEBAQEBAQEBAQESAQEJCwsIJjGCMyCCbBUIARseAxIQDwImA?= =?us-ascii?q?iURAQUBLwgBAYoCAQMIDQSfFoNFP4wIggQFARyDCgWDXAoZJw1WgnEqAgYJAQh?= =?us-ascii?q?5hQ6CTwuID4I6gl8FnVGBW5EzimsQhmOSYTOBFTeBKi4gCBkVXYRJghBzh2wBA?= =?us-ascii?q?QE?= X-IronPort-AV: E=Sophos;i="5.37,388,1488841200"; d="scan'208";a="270963588" Received: from mail-it0-f54.google.com ([209.85.214.54]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 28 Apr 2017 16:36:24 +0200 Received: by mail-it0-f54.google.com with SMTP id 70so39348418ita.0 for ; Fri, 28 Apr 2017 07:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=3OlzfxJqkvNIS+y2dDa/e/nQeM/2rRdebs9R2IF2Nes=; b=pbHVWRRn7wmafqa0TcvJIWEIKxhv+6bHs5IKG356AgWQN8xfkE+iLkU1ocYdId///M TUui+4sJ34HnO/tqYSfwCzxX/+dImlzR0MgVs0iJoVWA6FNUFWoXmz4dpWvEajf19ZGf bYENc/hSvcLABhU1eiFPOlwbg/Xw/Xd3oNcdEy637+K4QnZG9hqw5rAEg26mbtjSOwdI R73eEbGDMRznYq/yooO3t8+7yXW9pyiXEOR0qpR/iiLxqFPFSsR2BaslyN+ebNZDXLlD Wg5UrYcRqb/15c3Md9/HTiL/Jk37AOTwx1lJfcv44blEBsVS4Hf3iKzBH7EeNNZOepd1 Gv+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=3OlzfxJqkvNIS+y2dDa/e/nQeM/2rRdebs9R2IF2Nes=; b=Gq6LHm8e90idFkbC4lkXMAlycWjVd+4SWKDhVlb1jOzq207xCPVUUMHeUz5B3hagCi eaqpjaGoWBbbQgEiNpNOuWgr0by8zrkd0brpNXsFKmKeQHd7iRRXJA+mSx6GHGbtDbNT xscg0/L7FY37/iPBZVCKqu+diHBJjs6QnzkbsQDOKSwbf70i7GDqUr9PnhfAgx29DaZ/ fg7PPuXW1asoNWuBF3QNY2ZySmdBoWOEaWD41M+wZiKH3xSPsW67WmlWhmG7Z3ocPuDD ATd73QX4nPK9dLRIQC+XqowQC+PtLsRVsS5S7ZDxyHddj7Uv5MlsdXhc1CrT7ntp0RtN nU/A== X-Gm-Message-State: AN3rC/7EspAEFqOmyTF9RtjkPTZdVEYmxXpLMdyn52BZ+hJ/iTI9YPem d7g9jRW7+H+6nUjhPEs= X-Received: by 10.36.214.78 with SMTP id o75mr1681852itg.39.1493390182071; Fri, 28 Apr 2017 07:36:22 -0700 (PDT) Received: from [10.10.156.106] ([94.136.92.222]) by smtp.gmail.com with ESMTPSA id h42sm2487022ioi.16.2017.04.28.07.36.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Apr 2017 07:36:21 -0700 (PDT) To: caml-list@inria.fr From: Leonardo Laguna Ruiz Message-ID: <00fad276-cfec-0aca-9718-ae00a38f2437@gmail.com> Date: Fri, 28 Apr 2017 16:36:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: [Caml-list] Performance degradation when using '=' instead of 'compare' I don't know if this has been discussed before, but a few weeks back we detected a large performance degradation in our product. We tracked down the problem and turned out to be that an innocent looking line was changed. Something like this: if compare a b = 0 then .... else ... became: if a = b then ... else ... in our specific algorithm, 'a' and 'b' where values of some custom type. By looking at the ocaml runtime code we could see that 'compare' performs physical equality before doing the structural comparison. While '=' only performs structural equality. In our case, 'a' and 'b' were most of the times physically equal, and by changing to the operator '=' a full structural comparison of the object was performed. I wonder what's the reason why '=' does not uses physical equality. Now we are trying to track all the places where '=' is used and changing it to either: "a == b | a=b", or "compare a b = 0" Leonardo