[gui-dev] Re: [codepatch] A small optimization for SchemaReplyCollectionMapper
"Philippe Verdy" <[email protected]> Fri, 23 Jul 2004 18:12:01 +0200
| Newsgroups | gmane.network.gnutella.limewire.gui.devel |
|---|---|
| Message-ID | <000001c470d1$07d609c0$0b00a8c0@VENGEROV> |
There's a tradeoff here between using lazy initialization (requiring synchronized instanciation) which boost aplication startup, and a very tiny price related to synchronization of a method which is not so frequently called: mapping schema replies occurs only when a user is receiving replies to his own searches, and at most it would occur about 200 to 400 times per search initiated by the user, and only provided that all results have embedded meta-data. In practice, a search will run for a couple of minutes and will return about 80-100 results with meta-data, so this accessor will be used on average about 1-2 times per second. This is small enough to keep the synchronizartion on this, with the benefit of shortening the application launch time. Remember that there are still tons of users running a PC with less than 128MB RAM, and not all running Windows XP on a fast processor > 1GHz: on these system the application launch time, including the JVM startup and the VM swap on disk, is quite long, and I have a 4-years old PC for which LimeWire requires about 150 seconds to start and again 2 minutes to get connected. This very notable for most notebook users (unless you use one of the new very fast notebooks which now outperform many desktops). ----- Original Message ----- From: "Roger Kapsi" <[email protected]> To: <[email protected]> Sent: Friday, July 23, 2004 12:30 AM Subject: [codepatch] A small optimization for SchemaReplyCollectionMapper > > While tracking a NPE in DAAP I saw that SRCMapper.instance() is > unnecessarily synchronized. This patch will surely save some > nanoseconds! :) > > cu > Roger > > ---------------------------------------------------------------------------- ---- > _______________________________________________ > codepatch mailing list > [email protected] > http://www.limewire.org/mailman/listinfo/codepatch > _______________________________________________ gui-dev mailing list [email protected] http://www.limewire.org/mailman/listinfo/gui-dev