From owner-freebsd-java@FreeBSD.ORG Wed Oct 27 09:15:58 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B148516A4CE for ; Wed, 27 Oct 2004 09:15:58 +0000 (GMT) Received: from av4-2-sn3.vrr.skanova.net (av4-2-sn3.vrr.skanova.net [81.228.9.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71FAA43D39 for ; Wed, 27 Oct 2004 09:15:58 +0000 (GMT) (envelope-from pawel.worach@telia.com) Received: by av4-2-sn3.vrr.skanova.net (Postfix, from userid 502) id A815F37E42; Wed, 27 Oct 2004 11:15:57 +0200 (CEST) Received: from smtp1-1-sn3.vrr.skanova.net (smtp1-1-sn3.vrr.skanova.net [81.228.9.177]) by av4-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 981D637E42; Wed, 27 Oct 2004 11:15:57 +0200 (CEST) Received: from [192.168.1.1] (h65n2fls35o895.telia.com [217.211.109.65]) by smtp1-1-sn3.vrr.skanova.net (Postfix) with ESMTP id 57DA538018; Wed, 27 Oct 2004 11:15:57 +0200 (CEST) Message-ID: <417F6596.8050808@telia.com> Date: Wed, 27 Oct 2004 11:08:38 +0200 From: Pawel Worach User-Agent: Mozilla Thunderbird 0.8 (X11/20041019) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ian Grigg References: <417ECD08.8010805@systemics.com> In-Reply-To: <417ECD08.8010805@systemics.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-java@freebsd.org Subject: Re: Crypto takes 17 seconds to wind up for the throw... X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2004 09:15:58 -0000 Ian Grigg wrote: > Cipher DES: 17025 What takes time in this situation I belive is. // this depends on the quality of the randomness your system provides SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); // done by Cipher.getInstance("DES"); in the background, the constructor // of DESCipher is pretty slow, don't really know what is does, generates // keys? com.sun.crypto.provider.DESCipher dc = new com.sun.crypto.provider.DESCipher(); Random stir: 1155 (those two above combined) Cipher DES: 686 (if above is pre-done this goes faster) Your system must be quite slow if that takes 17 seconds, getInstance("DES") in your program out of the box took me 1230 msec. Java HotSpot(TM) Client VM (build 1.4.2-p6-current-2004-07-21, mixed mode) FreeBSD 6.0-CURRENT #0: Sun Oct 17 18:21:05 CEST 2004 PIII 600Mhz ps. Any plans for getting the hotspot profiler working? -- Pawel