NetBSD Problem Report #51333

From www@NetBSD.org  Mon Jul 11 12:14:57 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 425057A488
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 11 Jul 2016 12:14:57 +0000 (UTC)
Message-Id: <20160711121456.54FF37AAB6@mollari.NetBSD.org>
Date: Mon, 11 Jul 2016 12:14:56 +0000 (UTC)
From: zafer@netbsd.org
Reply-To: zafer@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: base openssl is 25% slower than pkgsrc openssl
X-Send-Pr-Version: www-1.0

>Number:         51333
>Category:       bin
>Synopsis:       base openssl is 25% slower than pkgsrc openssl
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 11 12:15:00 +0000 2016
>Last-Modified:  Mon Jul 11 15:30:01 +0000 2016
>Originator:     Zafer Aydogan
>Release:        7.0
>Organization:
TNF
>Environment:
amd64
>Description:
While deploying a NetBSD server to a cloud provider, I noticed that
openssl speed showed reduced results with NetBSD compared to SmartOS, FreeBSD or Linux.

Comparing a fresh build openssl from pkgsrc finally showed same results 
like the other OS.

Here is the comparison between base openssl and pkgsrc openssl.

The nominal expected value is 30000k for 16 bytes sha512.

Output shortened for readability:

Base openssl:
OpenSSL 1.0.1p 9 Jul 2015
NetBSD 7.0
gcc version 4.8.4 (NetBSD nb2 20150115)
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes 
sha512           21915.87k


Versus pkgsrc openssl:
OpenSSL 1.0.2h  3 May 2016
built on: reproducible build, date unspecified
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes
sha512           29093.30k

The difference between pkgsrc and base is 24.67%


>How-To-Repeat:
$ openssl speed sha512



>Fix:
yes, please.

>Audit-Trail:
From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/51333: base openssl is 25% slower than pkgsrc openssl
Date: Mon, 11 Jul 2016 14:38:47 +0200

 On Mon, Jul 11, 2016 at 12:15:00PM +0000, zafer@netbsd.org wrote:
 > >Description:
 > While deploying a NetBSD server to a cloud provider, I noticed that
 > openssl speed showed reduced results with NetBSD compared to SmartOS, FreeBSD or Linux.

 We don't use OpenSSL's SHA2 implementation as it overlaps with libc.

 Joerg

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/51333: base openssl is 25% slower than pkgsrc openssl
Date: Mon, 11 Jul 2016 14:20:00 +0000

 On Mon, Jul 11, 2016 at 12:40:01PM +0000, Joerg Sonnenberger wrote:
  >  > While deploying a NetBSD server to a cloud provider, I noticed that
  >  > openssl speed showed reduced results with NetBSD compared to SmartOS, FreeBSD or Linux.
  >  
  >  We don't use OpenSSL's SHA2 implementation as it overlaps with libc.

 so the sha2 in libc is slow?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, zafer@netbsd.org
Subject: Re: bin/51333: base openssl is 25% slower than pkgsrc openssl
Date: Mon, 11 Jul 2016 17:29:11 +0200

 On Mon, Jul 11, 2016 at 02:25:01PM +0000, David Holland wrote:
 > The following reply was made to PR bin/51333; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-bugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: bin/51333: base openssl is 25% slower than pkgsrc openssl
 > Date: Mon, 11 Jul 2016 14:20:00 +0000
 > 
 >  On Mon, Jul 11, 2016 at 12:40:01PM +0000, Joerg Sonnenberger wrote:
 >   >  > While deploying a NetBSD server to a cloud provider, I noticed that
 >   >  > openssl speed showed reduced results with NetBSD compared to SmartOS, FreeBSD or Linux.
 >   >  
 >   >  We don't use OpenSSL's SHA2 implementation as it overlaps with libc.
 >  
 >  so the sha2 in libc is slow?

 Well, it's portable C code. Whether the difference justies looking at an
 assembler version is a different question. There might even be potential
 for improving the existing version.

 Joerg

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.