From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giuseppe Scrivano Subject: Re: Linus' sha1 is much faster! Date: Mon, 17 Aug 2009 12:51:17 +0200 Message-ID: <8763cmemsa.fsf@master.homenet> References: <4A85F270.20703@draigBrady.com> <87eirbef3c.fsf@master.homenet> <4A88B80D.40804@draigBrady.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Bug-coreutils@gnu.org, Linus Torvalds , Git Mailing List To: =?utf-8?Q?P=C3=A1draig?= Brady X-From: git-owner@vger.kernel.org Mon Aug 17 12:53:01 2009 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mczpj-0007rS-3e for gcvg-git-2@lo.gmane.org; Mon, 17 Aug 2009 12:52:59 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757498AbZHQKwv convert rfc822-to-quoted-printable (ORCPT ); Mon, 17 Aug 2009 06:52:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756890AbZHQKwu (ORCPT ); Mon, 17 Aug 2009 06:52:50 -0400 Received: from averell.mail.tiscali.it ([213.205.33.55]:55995 "EHLO averell.mail.tiscali.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbZHQKwu convert rfc822-to-8bit (ORCPT ); Mon, 17 Aug 2009 06:52:50 -0400 Received: from master.homenet (84.222.168.55) by averell.mail.tiscali.it (8.0.022) id 49CBA137048362B8; Mon, 17 Aug 2009 12:52:40 +0200 Received: from gscrivano by master.homenet with local (Exim 4.69) (envelope-from ) id 1Mczo6-0006Pt-0V; Mon, 17 Aug 2009 12:51:18 +0200 In-Reply-To: <4A88B80D.40804@draigBrady.com> (=?utf-8?Q?=22P=C3=A1draig?= Brady"'s message of "Mon, 17 Aug 2009 02:53:17 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: P=C3=A1draig Brady writes: > -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions > -fstack-protector --param=3Dssp-buffer-size=3D4 -m32 -march=3Di586 > -mtune=3Dgeneric -fasynchronous-unwind-tables -D_GNU_SOURCE=3D1 thanks. I did again all tests on my machine using these same options. I repeated each test 6 times and I took the median without consider the first result. Except the first run that it is not considered, I didn't report a big variance on results of the same test. gcc 4.3.3 gnulib sha1: real 0m2.543s gnulib sha1 lookup: real 0m1.906s (-25%) linus's sha1: real 0m2.468s (-3%) linus's sha1 no asm: real 0m2.289s (-9%) gcc 4.4.1 gnulib sha1: real 0m3.386s gnulib sha1 lookup: real 0m3.110s (-8%) linus's sha1: real 0m1.701s (-49%) linus's sha1 no asm: real 0m1.284s (-62%) I don't see such big differences in asm generated by gcc 4.4.1 and gcc 4.3.3 to explain this performance difference, what I noticed immediatel= y is that in the gcc-4.4 generated asm there are more "lea" instructions (+30%), but I doubt this is the reason of these poor results. Anyway, = I haven't yet looked much in details. Cheers, Giuseppe