patchmldonkey, a multi-networks file-sharing client - Patches: patch #4543, Lower CPU usage (mldonkey 2.6.x)

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4543: Lower CPU usage (mldonkey 2.6.x)

Submitter:  pango <mlpango>
Submitted:  Sun 23 Oct 2005 03:34:11 PM UTC
   
 
Category:  Bug fixes Priority:  5 - Normal
Status:  Done Assigned to:  spiralvoice
Open/Closed:  Closed

Mon 24 Oct 2005 07:40:52 PM UTC, comment #2: 

There should be no problem by leaving a X.iter by an exception, we do it all time, "Exit" is a good candidate for this :) And stdlib says:
val iter : ('a -> unit) -> 'a t -> unit
iter f q applies f in turn to all elements of q, from the least recently entered to the most recently entered. The queue itself is unchanged.

Building now my core with --enable-profile too, many eyes see more

Good hunting!

bogeyman <bogeyman>
Group Member
Sun 23 Oct 2005 04:04:58 PM UTC, comment #1: 

Applied 2005/10/23

spiralvoice <spiralvoice>
Group administrator
Sun 23 Oct 2005 03:34:11 PM UTC, original submission:  

Several people have reported high CPU usage, or symptoms that could be related to a high CPU usage (web interface sluggishness, lowid from servers, upload speed drop,...). See http://mldonkey.berlios.de/modules.php?name=Forums&file=viewtopic&t=3859

After some profiling (see http://download.berlios.de/pub/mldonkey/pango/profiling/), it seems that CommonSources.count_file_ready_sources is using way too many cpu cycles: it's both costly (scanning whole sources queues), and used often (once every 2ms on average on my test!).

Here's a patch that tries to make it more efficient (strength reduction and, sig early abort using an exception), and also called less often by some optimization of find_max_overloaded.

On the same computer (P3 500MHz), a popular download now uses ~ 20% of cpu, with very few usage peaks. Network traffic is much smoother.

There's probably more to do (Why is this function called this often ? What other functions need to be optimized ?...)

pango <mlpango>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-10-23 spiralvoice StatusNone Done
    Open/ClosedOpen Closed
2005-10-23 mlpango Attached File- Added count_file_ready_sources_optim_v2.patch, #5357

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code