Philippe Verdy
2004-07-23 16:12:01 UTC
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" <***@kapsi.de>
To: <***@limewire.org>
Sent: Friday, July 23, 2004 12:30 AM
Subject: [codepatch] A small optimization for SchemaReplyCollectionMapper
----
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" <***@kapsi.de>
To: <***@limewire.org>
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
----------------------------------------------------------------------------unnecessarily synchronized. This patch will surely save some
nanoseconds! :)
cu
Roger
----
_______________________________________________
codepatch mailing list
http://www.limewire.org/mailman/listinfo/codepatch
codepatch mailing list
http://www.limewire.org/mailman/listinfo/codepatch