Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 80130 invoked from network); 20 Nov 2008 07:16:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2008 07:16:37 -0000 Received: (qmail 95188 invoked by uid 500); 20 Nov 2008 07:16:45 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 95163 invoked by uid 500); 20 Nov 2008 07:16:44 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 95152 invoked by uid 99); 20 Nov 2008 07:16:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2008 23:16:44 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of junjie0122@gmail.com designates 209.85.132.246 as permitted sender) Received: from [209.85.132.246] (HELO an-out-0708.google.com) (209.85.132.246) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Nov 2008 07:15:22 +0000 Received: by an-out-0708.google.com with SMTP id d14so161032and.0 for ; Wed, 19 Nov 2008 23:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=ntg6jjLaU7z5aFnG8IagiTYoQfxOgLIRVui2mzMhWYc=; b=ELcNxUEGuk45ypGznpFmJjsqGzdCLzAQCk9V/A2rmorwJ07lgzpGmriyyaluiLdv/v jl4xPbYLmR3L9e1EQNG+fIauAEvDdA1arbhKGRSfyrCpbR90J5H6FlZhaIf2i+8jpg7c R9ZswkFT/KXeVt02MbHd4rbLDbosOPQtgaX3M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=KjKoVtPNgmAbmGD1iUjWc42jiDHESmcBJAW36rrep4GnproIEzdZRihQAKNKRkskV9 YuNbRiwWYRT9H5BEg+6LrwBhjuS5mSMgAXqHp0yFBM6eqPSSCeTKayD348JXQyFTaqJi TAWF/NjrV8jdffxTf5MKe5uPXR/K31d38YNP8= Received: by 10.100.123.11 with SMTP id v11mr1049807anc.71.1227165366771; Wed, 19 Nov 2008 23:16:06 -0800 (PST) Received: by 10.100.5.10 with HTTP; Wed, 19 Nov 2008 23:16:06 -0800 (PST) Message-ID: Date: Thu, 20 Nov 2008 15:16:06 +0800 From: "Jim Yu" To: dev@harmony.apache.org Subject: Re: [classlib][luni] Redundant and repeated external properties loading using ResourceBundle may degrade performance. In-Reply-To: <94d710af0811191832o1ad64406w957e5c8bb8e7aebe@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_86417_4022422.1227165366767" References: <4924C68E.8090104@gmail.com> <94d710af0811191832o1ad64406w957e5c8bb8e7aebe@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_86417_4022422.1227165366767 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In addition, using ResourceBundle in Harmony can make the message output be easily localized into different languages. And it is very convenient to support more locales in the future. 2008/11/20 Sean Qiu > We can benefit from it when exceptions are thrown many times. > But we rarely encounter this situation in our application :) > To save the memory, space outweigh time in this case. > > Correct me if I'm wrong. > > 2008/11/20 Kevin Zhou > > > Hi, > > I read some code in LUNI module of Harmony. > > (org.apache.harmony.luni.util.Msg/MsgHelp and java.util.ResourceBundle) > > I found that Harmony uses ResourceBundle to load messages from external > > properties file. > > e.g. Once it requires a message "K0046", it will always use > > ResourceBundle to go through the > > org.apache.harmony.luni.util.ExternalMessages.properties file to search > it. > > I think such redundant and repeated I/O operations may degrade our > > performance. > > > > Why not use a hashtable to store all the external messages? It only > > requires several I/O operations initially! > > > > > > > > > -- > Best Regards > Sean, Xiao Xia Qiu > > China Software Development Lab, IBM > -- Best Regards, Jim, Jun Jie Yu China Software Development Lab, IBM ------=_Part_86417_4022422.1227165366767--