Return-Path: X-Original-To: apmail-santuario-dev-archive@www.apache.org Delivered-To: apmail-santuario-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B53CB118CC for ; Thu, 12 Jun 2014 13:48:23 +0000 (UTC) Received: (qmail 74910 invoked by uid 500); 12 Jun 2014 13:48:23 -0000 Delivered-To: apmail-santuario-dev-archive@santuario.apache.org Received: (qmail 74877 invoked by uid 500); 12 Jun 2014 13:48:23 -0000 Mailing-List: contact dev-help@santuario.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@santuario.apache.org Delivered-To: mailing list dev@santuario.apache.org Received: (qmail 74870 invoked by uid 99); 12 Jun 2014 13:48:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 13:48:23 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [213.179.18.11] (HELO mail.primekey.se) (213.179.18.11) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2014 13:48:18 +0000 Received: from mail.primekey.se (localhost [127.0.0.1]) by mail.primekey.se (Postfix) with ESMTP id 54F6E45C0103 for ; Thu, 12 Jun 2014 15:47:57 +0200 (CEST) Received: from [192.168.3.140] (gatekeeper.primekey.se [37.247.8.53]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.primekey.se (Postfix) with ESMTPSA id 2115A45C00FE for ; Thu, 12 Jun 2014 15:47:57 +0200 (CEST) Message-ID: <5399AF8C.30409@primekey.se> Date: Thu, 12 Jun 2014 15:47:56 +0200 From: =?UTF-8?B?TWFya3VzIEtpbMOlcw==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: dev@santuario.apache.org Subject: Re: Patch performance regression as signature data is not buffered References: <53999FE6.8070303@primekey.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Checked: Checked by ClamAV on apache.org No problem, here you go: https://issues.apache.org/jira/browse/SANTUARIO-393 Cheers, Markus On 2014-06-12 15:38, Colm O hEigeartaigh wrote: > > Could you create a new JIRA here + attach the patch to it? > > https://issues.apache.org/jira/browse/SANTUARIO > > Colm. > > > On Thu, Jun 12, 2014 at 1:41 PM, Markus Kilås > wrote: > > Hi, > > After upgrading from xmlsec (java) 1.4 to 1.5 we saw a significant drop > in signature generation performance especially when using a network > based HSM. > > After some investigation it turns out that the problem is that the > hashing is done with one byte at a time which with network latencies > gives the bad performance. > > Looking in the code of DOMSignedInfo.java it looks like the code intends > to use an UnsyncBufferedOutputStream however only its close method is > actually called, which as far as I can see won't have any side affect at > all when operated on a ByteArrayOutputStream. > > The attached patch resolves the performance issue by actually using the > UnsyncBufferedOutputStream and that way perform the digests on a > possibly full buffer instead of byte by byte. The patch has been tested > on version 1.5.5 but also applies on 1.5.6. > > > Downstream ticket in SignServer: > https://jira.primekey.se/browse/DSS-698 > > -- > Kind regards, > Markus Kilås > PrimeKey Solutions > > > > > -- > Colm O hEigeartaigh > > Talend Community Coder > http://coders.talend.com -- Kind regards, Markus Kilås PKI Specialist PrimeKey Solutions AB Anderstorpsv. 16 171 54 Solna Sweden Phone: +46 70 424 94 85 Skype: markusatskype Email: markus.kilas@primekey.se www.primekey.se