On Friday 15 August 2008 20:22, [EMAIL PROTECTED] wrote:
> Author: nextgens
> Date: 2008-08-15 19:22:32 +0000 (Fri, 15 Aug 2008)
> New Revision: 21916
> 
> Modified:
>    trunk/freenet/src/freenet/node/PeerNode.java
> Log:
> PeerNode.getNumberOfSelections() is definitly too time consuming... and that 
makes PacketSender to freeze for to long

Ewwwww! Can't we just return the count? Or better yet, count the selections in 
some way that doesn't require two objects for every hit? Admittedly that 
would mean we could no longer get the number of selections in a given time 
period, but stuff based on that tends to cause oscillations...
> 
> Modified: trunk/freenet/src/freenet/node/PeerNode.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/PeerNode.java      2008-08-15 19:05:51 UTC 
(rev 21915)
> +++ trunk/freenet/src/freenet/node/PeerNode.java      2008-08-15 19:22:32 UTC 
(rev 21916)
> @@ -3984,8 +3984,9 @@
>       }
>       
>       public SortedSet<Long> getNumberOfSelections() {
> +             // FIXME: returning a copy is not an option: find a smarter way 
> of 
dealing with the synchronization
>               synchronized(numberOfSelectionsSync) {
> -                     return new TreeSet<Long>(numberOfSelections);
> +                     return numberOfSelections;
>               }
>       }

Attachment: pgpNJKH18jOcz.pgp
Description: PGP signature

_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to