Article View: borland.public.jbuilder.java.api
Article #1340Re: Java Properties vs XML
From: John McGrath TeamB
Date: Tue, 12 Mar 2002 15:39
Date: Tue, 12 Mar 2002 15:39
24 lines
1831 bytes
1831 bytes
On Mon, 11 Mar 2002 21:23:15 -0800, Dan Tran wrote:
> Could you enlighten me why java properies is
> faster interm of look up?
The Java Properties class is a HashTable, which offers fairly quick
lookup. A DOM tree is a tree structure, and if you are using simple
name value pairs, I presume the properties would all be children of
the root node, so the lookup would be sequential. A HashTable should
give you much better performance than sequential lookup.
Of course, if you were loading the properties from a DOM tree and doing
a significant number of lookups, you would probably want to push them
into a HashTable (or HashMap) to speed things up. The result would be
the same speed as using the Properties object.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.16f7eb34e5b57b2f98b42d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!212.43.194.69!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3c8bd80c$1_1@dnews> <MPG.16f72e0efc162bab98b428@newsgroups.borland.com> <3c8d911b$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,f99390192887b3fa X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-03-12 07:42:35 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.api Subject: Re: Java Properties vs XML Date: Tue, 12 Mar 2002 10:39:19 -0500 Message-ID: <MPG.16f7eb34e5b57b2f98b42d@newsgroups.borland.com> References: <3c8bd80c$1_1@dnews> <MPG.16f72e0efc162bab98b428@newsgroups.borland.com> <3c8d911b$1_1@dnews> X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 1015947559 209.92.40.60 (12 Mar 2002 07:39:19 -0800) Lines: 24 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!212.43.194.69!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews