Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 87557 invoked from network); 26 Jun 2006 16:26:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2006 16:26:59 -0000 Received: (qmail 21811 invoked by uid 500); 26 Jun 2006 16:26:46 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 21790 invoked by uid 500); 26 Jun 2006 16:26:46 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 21779 invoked by uid 99); 26 Jun 2006 16:26:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 09:26:45 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.10.57] (HELO web25109.mail.ukl.yahoo.com) (217.12.10.57) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 26 Jun 2006 09:26:44 -0700 Received: (qmail 31649 invoked by uid 60001); 26 Jun 2006 16:26:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=RSjGAIlRI5y1R/U2H5ehOlD3dxHzSKhPEA9MRO2Ncdjps1JQxwHqhky7h1Hmd7apeaBVmRfvPGwp6RxNOERFgudPtjzhF7rb+88tYhS3f/TG6pYB8b/rYAH/vr1FmJNjmjFK70gi9nS6jDzfvvuYI/UOjWqlnAwA763AG+bmtaw= ; Message-ID: <20060626162622.31647.qmail@web25109.mail.ukl.yahoo.com> Received: from [212.8.105.100] by web25109.mail.ukl.yahoo.com via HTTP; Mon, 26 Jun 2006 18:26:22 CEST Date: Mon, 26 Jun 2006 18:26:22 +0200 (CEST) From: password password Subject: sort an array To: users@tomcat.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2081893949-1151339182=:31341" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-2081893949-1151339182=:31341 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, I have a servlet and in this servlet I have a problem when sort an array. If in Tomcat 5.5.4 (on windows) the order is very fast (about 2 seconds) , but in tomcat 5.5.9 is slower (about 25 seconds). I don't Know why the same code has diferent time. The code is the next. The array has 7000 elements. ////////////////////////////////////////////////////////////////////////////////////////////////////////// java.util.Date datTiempoInicio, datTiempoFin; java.util.Calendar calTiempoInicio = Calendar.getInstance(); java.util.Calendar calTiempoFin = Calendar.getInstance(); long intTiempoUtilizado; datTiempoInicio = new java.util.Date(); calTiempoInicio.setTime(datTiempoInicio ); if (astrName.length > 1) { //ordenacion de los arrays: astrName[intFilaArray] int i, pasadas; String strTemp; double dblIntensityTemp; double dblBackgroundTemp; int intComparacion; for (pasadas = 1; pasadas < astrName.length; pasadas++) { for (i = 0; i 0) { strTemp = astrName[i]; astrName[i] = astrName[i + 1]; astrName[i + 1] = strTemp; dblIntensityTemp = adblIntensity1[i]; adblIntensity1[i] = adblIntensity1[i + 1]; adblIntensity1[i + 1] = dblIntensityTemp; dblIntensityTemp = adblIntensity2[i]; adblIntensity2[i] = adblIntensity2[i + 1]; adblIntensity2[i + 1] = dblIntensityTemp; dblBackgroundTemp = adblBackground1[i]; adblBackground1[i] = adblBackground1[i + 1]; adblBackground1[i + 1] = dblBackgroundTemp; dblBackgroundTemp = adblBackground2[i]; adblBackground2[i] = adblBackground2[i + 1]; adblBackground2[i + 1] = dblBackgroundTemp; } // end if (intComparacion > 0) } //end for i } //end for pasadas } // end if (astrName.length > 1) datTiempoFin = new java.util.Date(); calTiempoFin.setTime(datTiempoFin ); intTiempoUtilizado = Math.abs( (calTiempoFin.getTimeInMillis() - calTiempoInicio.getTimeInMillis()) / (1000) ); System.out.println("(ProcessFile) Time = " + intTiempoUtilizado ); //////////////////////////////////////////////////////////////////////////////////////////////// Can You help me? --------------------------------- LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y m�viles desde 1 c�ntimo por minuto. http://es.voice.yahoo.com --0-2081893949-1151339182=:31341--