From owner-freebsd-current@freebsd.org Wed Sep 12 23:46:49 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D98310A00D7 for ; Wed, 12 Sep 2018 23:46:49 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E862A77D10 for ; Wed, 12 Sep 2018 23:46:48 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id AD36F10A00D4; Wed, 12 Sep 2018 23:46:48 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE2610A00D2 for ; Wed, 12 Sep 2018 23:46:48 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [IPv6:2a01:4f8:201:6350::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3E25777D0C; Wed, 12 Sep 2018 23:46:48 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:bd86:f15a:5ec9:e91e]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id 175197BC; Thu, 13 Sep 2018 02:46:47 +0300 (MSK) Date: Thu, 13 Sep 2018 02:46:46 +0300 From: Lev Serebryakov Reply-To: Lev Serebryakov Organization: FreeBSD Message-ID: <43892083.20180913024646@serebryakov.spb.ru> To: current@FreeBSD.org CC: brnrd@FreeBSD.org, jkim@FreeBSD.org Subject: Speed problems with both system openssl and security/openssl-devel MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2018 23:46:49 -0000 Hello Brnrd, I'm benchmarking new hardware (rather limited one, but still) which supports AES-NI (Celeron J3160). I'm comparing simple "openssl speed aes-256-cbc" and "openssl speed -evp aes-256-cbc" on FreeBSD 12-ALPHA4 (built by myself with all debug options turned off) and Debian Linux 9.5.0 booted from install DVD (without installation). Simple "openssl speed aes-256-cbc" shows same numbers both in single-threaded and multi-threaded mode (for all 4 cores). Linux is marginally faster, but it is in the margin of measurement error. But "openssl speed -evp aes-256-cbc" gives me very disappointing results. FreeBSD's openssl is WAY slower than Linux one. It is even slower than non-evp mode for small blocks. Here are results (As reported by openssl, with fractions dropped): Lin 18942 20637 21300 57967 58769 58769 Free 18931 20591 21282 58342 58731 58779 Lin-evp 97049 151466 183905 194385 197514 197727 Free-evp 2838 10845 35362 81892 131264 137579 Linux have openssl 1.1.0f, and I've tried both system /usr/bin/openssl (1.0.2p) and /usr/local/bin/openssl from security/openssl-devel port (1.1.0i), results are virtually the same. I have "ASM" and "SSE2" options enabled in port. What happens here? Why does FreeBSD's build of openssl use AES-NI so inefficient? -- Best regards, Lev mailto:lev@FreeBSD.org