<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">No, otherwise I’d have pick it instead of this one ;-)<div class=""><br class=""><div class="">The alternative plan was either to:</div><div class="">1) reach out to someone who has written an optimized one and convince him to contribute it to LLVM</div><div class="">2) “optimize” the one in tree.</div><div class=""><br class=""></div><div class="">But not high enough in my priority list.</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 16, 2016, at 4:13 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" class="">ruiu@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I should've said that do you know if there's an optimized SHA1 implementation that we can use?</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Nov 16, 2016 at 4:11 PM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">The current implementation was “copy/pasted” from somewhere (it was explicitly public domain).<div class=""><div class="h5"><div class=""><br class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Nov 16, 2016, at 4:05 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank" class="">ruiu@google.com</a>> wrote:</div><br class="m_838021890767585268Apple-interchange-newline"><div class=""><div dir="ltr" class="">Can we just copy-and-paste optimized code from somewhere?</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Nov 16, 2016 at 4:03 PM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">SHA1 in LLVM is *very* naive, any improvement is welcome there!<div class="">It think Amaury pointed it originally and he had an alternative implementation IIRC.</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="m_838021890767585268h5"><div class="">On Nov 16, 2016, at 3:58 PM, Rui Ueyama via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_838021890767585268m_-254240913159878184Apple-interchange-newline"></div></div><div class=""><div class=""><div class="m_838021890767585268h5"><div dir="ltr" class="">By the way, while running benchmark, I found that our SHA1 function seems much slower than the one in gold. gold slowed down by only 1.3 seconds to compute a SHA1 of output, but we spent 6.0 seconds to do the same thing (I believe). Something doesn't seem right.<div class=""><br class=""></div><div class="">Here is a table to link the same binary with -no-threads and -build-id={none,md5,sha1}. The numbers are in seconds.</div><div class=""><br class=""></div><div class=""><div class=""><font face="monospace, monospace" class="">       LLD   gold</font></div><div class=""><font face="monospace, monospace" class="">none   7.82  13.78</font></div><div class=""><font face="monospace, monospace" class="">MD5    9.68  14.56</font></div><div class=""><font face="monospace, monospace" class="">SHA1  13.85  15.05</font></div></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Nov 16, 2016 at 1:46 PM, Rafael Espíndola <span dir="ltr" class=""><<a href="mailto:rafael.espindola@gmail.com" target="_blank" class="">rafael.espindola@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 16 November 2016 at 15:52, Rafael Espíndola<br class="">
<span class=""><<a href="mailto:rafael.espindola@gmail.com" target="_blank" class="">rafael.espindola@gmail.com</a>> wrote:<br class="">
> I will do a quick benchmark run.<br class="">
<br class="">
<br class="">
</span>On a mac pro (running linux) the results I got with all cores available:<br class="">
<br class="">
firefox<br class="">
  master <a href="tel:7.146418217" value="+17146418217" target="_blank" class="">7.146418217</a><br class="">
  patch  5.<a href="tel:304271767%201" value="+13042717671" target="_blank" class="">304271767 1</a>.34729488437x faster<br class="">
firefox-gc<br class="">
  master <a href="tel:7.316743822" value="+17316743822" target="_blank" class="">7.316743822</a><br class="">
  patch  5.46436812 1.33899174824x faster<br class="">
chromium<br class="">
  master 4.265597914<br class="">
  patch  3.972218527 1.07385781648x faster<br class="">
chromium fast<br class="">
  master 1.823614026<br class="">
  patch  1.686059427 1.08158348205x faster<br class="">
the gold plugin<br class="">
  master 0.340167513<br class="">
  patch  0.318601465 1.06768973269x faster<br class="">
clang<br class="">
  master 0.579914119<br class="">
  patch  0.520784947 1.11353855817x faster<br class="">
llvm-as<br class="">
  master 0.03323043<br class="">
  patch  0.041571719 1.251013574x slower<br class="">
the gold plugin fsds<br class="">
  master 0.36675887<br class="">
  patch  0.350970944 1.04498356992x faster<br class="">
clang fsds<br class="">
  master 0.656180056<br class="">
  patch  0.591607603 1.10914743602x faster<br class="">
llvm-as fsds<br class="">
  master 0.030324313<br class="">
  patch  0.040045353 1.32056917497x slower<br class="">
scylla<br class="">
  master 3.23378908<br class="">
  patch  2.019191831 1.60152642773x faster<br class="">
<br class="">
With only 2 cores:<br class="">
<br class="">
firefox<br class="">
  master 7.174839911<br class="">
  patch  6.319808477 1.13529388384x faster<br class="">
firefox-gc<br class="">
  master 7.345525844<br class="">
  patch  6.493005841 1.13129820362x faster<br class="">
chromium<br class="">
  master 4.180752414<br class="">
  patch  4.129515199 1.01240756179x faster<br class="">
chromium fast<br class="">
  master 1.847296843<br class="">
  patch  1.78837299 1.0329483018x faster<br class="">
the gold plugin<br class="">
  master 0.341725451<br class="">
  patch  0.339943222 1.0052427255x faster<br class="">
clang<br class="">
  master 0.581901114<br class="">
  patch  0.566932481 1.02640284955x faster<br class="">
llvm-as<br class="">
  master 0.03381059<br class="">
  patch  0.036671392 1.08461260215x slower<br class="">
the gold plugin fsds<br class="">
  master 0.369184003<br class="">
  patch  0.368774353 1.00111084189x faster<br class="">
clang fsds<br class="">
  master 0.660120583<br class="">
  patch  0.641040511 1.02976422187x faster<br class="">
llvm-as fsds<br class="">
  master 0.031074029<br class="">
  patch  0.035421531 1.13990789543x slower<br class="">
scylla<br class="">
  master 3.243011681<br class="">
  patch  2.630991522 1.23261958615x faster<br class="">
<br class="">
<br class="">
With only 1 core:<br class="">
<br class="">
firefox<br class="">
  master 7.174323116<br class="">
  patch  7.301968002 1.01779190649x slower<br class="">
firefox-gc<br class="">
  master 7.339104117<br class="">
  patch  7.466171668 1.01731376868x slower<br class="">
chromium<br class="">
  master 4.176958448<br class="">
  patch  4.188387233 1.00273615003x slower<br class="">
chromium fast<br class="">
  master 1.848922713<br class="">
  patch  1.858714219 1.00529578978x slower<br class="">
the gold plugin<br class="">
  master 0.342383846<br class="">
  patch  0.347106743 1.01379415838x slower<br class="">
clang<br class="">
  master 0.582476955<br class="">
  patch  0.600524655 1.03098440178x slower<br class="">
llvm-as<br class="">
  master 0.033248459<br class="">
  patch  0.035622988 1.07141771593x slower<br class="">
the gold plugin fsds<br class="">
  master 0.369510236<br class="">
  patch  0.376390506 1.01861997133x slower<br class="">
clang fsds<br class="">
  master 0.661267753<br class="">
  patch  0.683417482 1.03349585535x slower<br class="">
llvm-as fsds<br class="">
  master 0.030574688<br class="">
  patch  0.033052779 1.08105041006x slower<br class="">
scylla<br class="">
  master 3.236604638<br class="">
  patch  3.325831407 1.02756801617x slower<br class="">
<br class="">
Given that we have an improvement even with just two cores available, LGTM.<br class="">
<br class="">
Cheers,<br class="">
Rafael<br class="">
</blockquote></div><br class=""></div></div></div>
______________________________<wbr class="">_________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>