https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082009-09-28T21:54:48ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=75032009-09-28T21:54:48Zalexh
<ul></ul><p>ok, I've tried with a pkgsrc compiled one on a different machine, and also with <br />our base openssl, results:<br />pkgsrc:<br />% LD_LIBRARY_PATH=. apps/openssl speed aes-128-cbc<br />...<br />type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes<br />aes-128 cbc 32231.84k 50363.14k 58405.02k 56728.83k 63585.82k</p>
<p>native:<br />...<br />type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes<br />aes-128 cbc 24142.68k 24968.12k 25585.41k 25565.77k 24387.99k</p>
<p>Something is seriously wrong with our configuration, and I assume it to be the <br />missing -DOPENSSL_THREADS.</p> DragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=75092009-09-29T01:26:11Zcorecode
<ul></ul><p>Alex Hornung (via DragonFly issue tracker) wrote:</p>
<blockquote>
<p>Something is seriously wrong with our configuration, and I assume it to be the <br />missing -DOPENSSL_THREADS.</p>
</blockquote>
<p>Maybe also missing assembler code.</p>
<p>cheers<br /> simon</p> DragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=92822010-11-17T02:45:17Zpavalos
<ul></ul><p>I'm working on bringing in asm code and threading for openssl.</p> DragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=93032010-11-21T17:07:39Zpavalos
<ul></ul><p>Well I have i386 working, but I'm getting the following error with x86_64:</p>
/home/pavalos/root/usr/obj/home/pavalos/pavalos/ctools_x86_64_x86_64/usr/libexe<br />c/binutils217/elf/ld: x86_64cpuid.So: relocation R_X86_64_PC32 against <br />`OPENSSL_cpuid_setup' can not be used when making a shared object; recompile <br />with -fPIC<br />/home/pavalos/root/usr/obj/home/pavalos/pavalos/ctools_x86_64_x86_64/usr/libexe<br />c/binutils217/elf/ld: final link failed: Bad value
<ul>
<li>Error code 1</li>
</ul>
<p>Stop in /home/pavalos/pavalos/secure/lib/libcrypto.</p>
<p>Anyone have any ideas on that?</p>
<p>You can see the work at git://git.theshell.com/pavalos.git</p> DragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=93122010-11-22T16:00:46Zpavalos
<ul></ul><p>Ok, looks like I have x86_64 working now. I need to pass -Bsymbolic to the <br />linker. I'm running through a few more tests, and I'll commit later on. <br />Expect an email comparing speeds next...</p> DragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=93142010-11-22T19:29:57Zpeter
<ul></ul><p>Ok, OpenSSL now uses vendor-provided assembly in libcrypto as of<br />aa1f363092970a87daaa258f83ca0fd6be992888. Attached are some files<br />recording the output of openssl speed:</p>
<p>i386 - no assembly on the i386 arch<br />i386-asm - assembly on the i386 arch<br />x86_64 - no assembly on the x86_64 arch<br />x86_64-asm - assembly on the x86_64 arch</p>
<p>--Peter</p> DragonFlyBSD - Bug #1542: bad crypto performance (using openssl)https://bugs.dragonflybsd.org/issues/1542?journal_id=93152010-11-22T19:45:38Zmneumann
<ul></ul><p>Strange, for x86_64 aes-128 (and others) are much slower for small sizes<br />with asm than without.</p>
<p>with asm:</p>
<p>aes-128 cbc 99800.49k 106699.15k 108852.40k 277620.74k<br />281411.58k</p>
<p>w/o asm:</p>
<p>aes-128 cbc 146135.83k 155790.60k 158851.09k 159470.71k<br />159413.51k</p>
<p>Regards,</p>
<pre><code>Michael</code></pre>