git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Linus' sha1 is much faster!

From
Giuseppe Scrivano <gscrivano@gnu.org>
Date
Aug 17, 2009, 10:51 UTC
Message-ID
<8763cmemsa.fsf@master.homenet>
In-Reply-To
<4A88B80D.40804@draigBrady.com>
Pádraig Brady <P@draigBrady.com> writes:
>   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
>   -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586
>   -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE=1

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 immediately 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

Previous: Pádraig BradyNext: Steven Noonan
Message 17 of 21 in “Linus' sha1 is much faster!”
  1. Pádraig BradyAug 14, 2009
  2. Bryan DonlanAug 15, 2009
  3. John TapsellAug 15, 2009
  4. Linus TorvaldsAug 15, 2009
  5. Linus TorvaldsAug 15, 2009
  6. Nicolas PitreAug 17, 2009
  7. Pádraig BradyAug 26, 2009
  8. galtApr 20, 2017
  9. galtApr 20, 2017
  10. Andreas EricssonAug 17, 2009
  11. Theodore TsoAug 16, 2009
  12. Giuseppe ScrivanoAug 16, 2009
  13. Linus TorvaldsAug 16, 2009
  14. Giuseppe ScrivanoAug 16, 2009
  15. Linus TorvaldsAug 16, 2009
  16. Pádraig BradyAug 17, 2009
  17. Giuseppe ScrivanoAug 17, 2009
  18. Steven NoonanAug 17, 2009
  19. Linus TorvaldsAug 17, 2009
  20. Steven NoonanAug 17, 2009
  21. Giuseppe ScrivanoAug 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.