From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 7AADC3858D20 for ; Mon, 7 Feb 2022 13:28:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7AADC3858D20 Received: by mail-pj1-x1031.google.com with SMTP id d9-20020a17090a498900b001b8bb1d00e7so2874221pjh.3 for ; Mon, 07 Feb 2022 05:28:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I47yGZi65Te4erqZLlN5bZ/yV/JZwyxBB/S474ntSyg=; b=XR8TeSXKPcb4Y/WRUgJhpI8B1p5TYUt0t0Gp/tYGIGoPvoYGotLhF4yRury/3lJvhZ 6sOUxwY2aEXdExaOjjfY8sD29ww+vQVRbeyRHSTPbsl52vvKxvSGztxa+dHdhyNPPT8f 1atPlVemeD3u7HliJFnlu/ld6DyJ/6fjcIEgJznFjsKCRsoUVyejxFPCM+/z1QdXU30p 0VZWaVFv/+a6L7shWiFqLKdXPHMorCJAMdLoA61cpKNW+1K6d46ppJH4Fhtl2ATnOUT5 UzJBlTyjot1VyVLSsFSYrxrVt1oxJjiOEEisbrkVFNoULK7bI8ByelGz1IHa+QdIpJL/ DrdQ== X-Gm-Message-State: AOAM532F9OrZcuI9y5iNK8FCEB3auaVtz49dPa83dk9nZ/H82u6Q3KET stfRJSvKWxjVUtEcLiClElI+3H0IaS6Ji+h1+cvL7N0rRuw= X-Google-Smtp-Source: ABdhPJxW7QX9ii4EcCrgTezRHLP7NcOh4AoxkWwHKqIdxI0PsEUedKMLx3hRCt2Rf++9eobVIjcxyJNqlgb3ZTfnemU= X-Received: by 2002:a17:902:e851:: with SMTP id t17mr15980222plg.102.1644240511632; Mon, 07 Feb 2022 05:28:31 -0800 (PST) MIME-Version: 1.0 References: <20220206210914.1593336-1-hjl.tools@gmail.com> <874k5b3afx.fsf@mid.deneb.enyo.de> <87tudbklhm.fsf@oldenburg.str.redhat.com> <87sfsuak62.fsf@oldenburg.str.redhat.com> In-Reply-To: <87sfsuak62.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 7 Feb 2022 05:27:55 -0800 Message-ID: Subject: Re: [PATCH] elf: Replace memcmp with __memcmpeq for variable size To: Florian Weimer Cc: "H.J. Lu via Libc-alpha" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3021.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2022 13:28:34 -0000 On Mon, Feb 7, 2022 at 5:19 AM Florian Weimer wrote: > > * H. J. Lu: > > >> This must be something else. According to the numbers, we save ~159 > >> between ~569 cycles per __memcmpeq call. That is just not realistic. > > > > I removed the cycle info from the commit log. > > If we can't show the change is beneficial, is it worth the additional > 1000 or so bytes in the loader text? > $ LD_DEBUG=statistics elf/tst-relsort1 --direct does show improvements when __memcmpeq is called 24 times. But the cycle number changes for each run. The overall trend is faster. It will be more obvious when memcmp is called more often. -- H.J.