Matthew Toseland wrote:
> On Wed, Jul 12, 2006 at 12:46:57PM -0500, David Sowder (Zothar) wrote:
>   
>> Matthew Toseland wrote:
>>     
>>> On Wed, Jul 12, 2006 at 10:39:49AM -0500, David Sowder (Zothar) wrote:
>>>  
>>>       
>>>> Matthew Toseland wrote:
>>>>    
>>>>         
>>>>> On Tue, Jul 11, 2006 at 05:40:22PM -0500, David Sowder (Zothar) wrote:
>>>>>
>>>>>      
>>>>>           
>>>>>> On my node, which is admittedly not setup to use more than the default 
>>>>>> 128 MB of RAM, the MemoryChecker run GC is done roughly every 30 
>>>>>> seconds and with the timing and before/after compare I've added 
>>>>>> locally, it's taking less than 2 seconds to complete, so this is hardly 
>>>>>> a big performance hit, at least on my machine.
>>>>>>
>>>>>> PacketSender perhaps needs to have a minimum sleepTime as well as a 
>>>>>> maximum sleep time?  That might be one place to reduce CPU load 
>>>>>> slightly?
>>>>>>   
>>>>>>        
>>>>>>             
>>>>> Not a good idea IMHO; if it needs to wake up to send a packet, it needs
>>>>> to wake up... they don't become urgent immediately...
>>>>>
>>>>>      
>>>>>           
>>>> We can't delay by up to 25-50 ms?
>>>>    
>>>>         
>>> We already delay.
>>>  
>>>       
>> The theory was that the PacketSender thread wouldn't wait 6 ms for the 
>> next scheduled action, but maybe 25 ms to reduce the likelihood that 
>> PacketSender is near 100% runnable CPU-wise.  I suppose this behavior 
>> could be fingerprinted though.
>>     
>
> We delay and queue stuff anyway. If we send a packet to a peer, we will
> include any queued messages for that peer; this is packet coalescing.
> Only after some time (200ms iirc) has passed does a message become
> urgent, and it will cause a packet send by itself. We do however wake
> the sender thread up when queueing a packet; maybe we can avoid this.
> I'll have a look sometime, though I doubt it's a major CPU eater.
>   
I haven't measured it's affect, but my idea was specifically about the 
sleepTime calculation at the end of PacketSender and adding a sleepTime 
min of 25 or something in addition to the current sleeptTime Math.max of 
200).  I implemented this locally, but like I said, I don't have any 
measurements.  One of these days, I'm probably going to look into 
profiling Java.

-- 
David R. Sowder
Supervisor of Language Acquisition Center
Department of Modern Languages
University of Texas at Arlington
    Work: 817-272-5148  davids at uta.edu    http://langlab.uta.edu/
Personal:               david at sowder.com  http://david.sowder.com/


Reply via email to