Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-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 7484E9297 for ; Thu, 8 Dec 2011 23:48:02 +0000 (UTC) Received: (qmail 16953 invoked by uid 500); 8 Dec 2011 23:48:01 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 16897 invoked by uid 500); 8 Dec 2011 23:48:01 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 16889 invoked by uid 99); 8 Dec 2011 23:48:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 23:48:01 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 23:48:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 0658E108EE4 for ; Thu, 8 Dec 2011 23:47:40 +0000 (UTC) Date: Thu, 8 Dec 2011 23:47:40 +0000 (UTC) From: "Yonik Seeley (Commented) (JIRA)" To: dev@lucene.apache.org Message-ID: <457030401.55654.1323388060027.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <704954057.15334.1311851229682.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (SOLR-2679) Optimize memory usage in JavaBinCodec.readStr() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-2679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165692#comment-13165692 ] Yonik Seeley commented on SOLR-2679: ------------------------------------ I think the right approach to increased efficiency here is to expose the byte[] of the FastInputStream. It's not a super-simple approach since it needs to operate chunk-at-a-time and deal with multi-byte chars crossing chunks. The goal of eliminating the double-buffering seems fine though - I think we can leave this issue open. > Optimize memory usage in JavaBinCodec.readStr() > ----------------------------------------------- > > Key: SOLR-2679 > URL: https://issues.apache.org/jira/browse/SOLR-2679 > Project: Solr > Issue Type: Improvement > Components: clients - java, Response Writers, update > Affects Versions: 3.3 > Reporter: Maxim Valyanskiy > Fix For: 3.6, 4.0 > > Attachments: SOLR-2679.patch > > > In Solr 3.3, JavaBinCodec.readStr() reads complete string into byte[] and then converts it into String. FastInputStream is already buffered, so this it not necessary and may take a lot of memory if data string is large. > This patch replaces usage of big byte[] with usage of dis.readUnsignedByte() for getting characters directly from stream. > Patch reduces memory usage and may slightly improve performance of reading text data in javabin-codec. > JavaBinCodec.readStr() function already has unit test in TestJavaBinCodec, no additional unit test is required. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org