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

Re: [PATCH] block-sha1: more good unaligned memory access candidates

From
Nicolas Pitre <nico@cam.org>
Date
Aug 13, 2009, 20:13 UTC
Message-ID
<alpine.LFD.2.00.0908131603240.10633@xanadu.home>
In-Reply-To
<7v63crbja2.fsf@alter.siamese.dyndns.org>
On Thu, 13 Aug 2009, Junio C Hamano wrote:
Show 16 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
> > As it is now, I was about to suggest:
> >
> > 	git mv block-sha1/sha1.[ch] .
> > 	rmdir block-sha1
> > 	rm -r mozilla-sha1
> > 	rm -r arm
> > 	rm -r ppc 
> >
> > and remove support for openssl's SHA1 usage, making this implementation 
> > unconditional.  After all it is faster, or so close to be faster than 
> > the alternatives, that we should probably cut on the extra dependency 
> > and simplify portability issues at the same time.
> 
> Wow.  Is it now faster than the arm/ and ppc/ hand-tweaked assembly?

It is indeed faster than the ARM assembly version by far, and faster than all the alternative implementations too, but with a 7x increase in compiled code size. In the context of Git I think this is a good compromize. Making the assembly version faster than the C version could be possible, but that would require quite some work and I don't expect the gain to be significant, certainly not worth the trouble.

Furthermore the C version can be used to generate ARM Thumb code while the asm version cannot without yet more work.

Nicolas
Previous: Linus TorvaldsNext: Brandon Casey
Message 6 of 15 in “block-sha1: more good unaligned memory access candidates”
  1. block-sha1: more good unaligned memory access candidatesNicolas Pitre, Aug 13, 2009
  2. Linus TorvaldsAug 13, 2009
  3. Nicolas PitreAug 13, 2009
  4. Junio C HamanoAug 13, 2009
  5. Linus TorvaldsAug 13, 2009
  6. Nicolas PitreAug 13, 2009
  7. block-sha1/sha1.c: silence compiler complaints by casting void* to uintptr_tBrandon Casey, Aug 14, 2009
  8. Johannes SchindelinAug 15, 2009
  9. Linus TorvaldsAug 15, 2009
  10. Brandon CaseyAug 15, 2009
  11. Junio C HamanoAug 15, 2009
  12. Brandon CaseyAug 15, 2009
  13. Junio C HamanoAug 15, 2009
  14. Linus TorvaldsAug 15, 2009
  15. Brandon CaseyAug 15, 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.