Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 2506 invoked from network); 29 Nov 2005 15:17:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Nov 2005 15:17:31 -0000 Received: (qmail 54577 invoked by uid 500); 29 Nov 2005 15:15:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54386 invoked by uid 500); 29 Nov 2005 15:15:26 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 54371 invoked by uid 99); 29 Nov 2005 15:15:26 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2005 07:15:19 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 14BF5DE for ; Tue, 29 Nov 2005 16:14:30 +0100 (CET) Message-ID: <1222170765.1133277270083.JavaMail.jira@ajax.apache.org> Date: Tue, 29 Nov 2005 16:14:30 +0100 (CET) From: "Daniel John Debrunner (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-731) org.apache.derby.impl.sql.compile.StringSlice is an inefficient way to do substring Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N org.apache.derby.impl.sql.compile.StringSlice is an inefficient way to do substring ----------------------------------------------------------------------------------- Key: DERBY-731 URL: http://issues.apache.org/jira/browse/DERBY-731 Project: Derby Type: Improvement Components: SQL Reporter: Daniel John Debrunner Assigned to: Daniel John Debrunner Priority: Trivial Fix For: 10.2.0.0 StringSlicer is a class that is basically implementing String.substring() with an optional trim in an inefficient manner. It creates a char array from the original string and uses this new array to create sub strings. This means one allocation and copy for the original char array and another allocation and copy for every subsequent slice operation. String.substring performs the same functionality but it can create sub-strings without the character array allocation and copy by re-using the character arrray hidden within the original string. I've been running tests with a additional code in StringSlicer that compares its output with that of String.substring with no differences. One minor annoyance is that StringSlicer uses an inclusive end offset while String.substring uses an exclusive end offset. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira