patchmldonkey, a multi-networks file-sharing client - Patches: patch #4613, Optimizing Set.cardinal

 
 

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

patch #4613: Optimizing Set.cardinal

Submitter:  pango <mlpango>
Submitted:  Sat 12 Nov 2005 08:32:03 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Assigned to:  spiralvoice
Open/Closed:  Closed

Sat 12 Nov 2005 11:12:15 AM UTC, comment #1: 

Applied 2005/11/12

spiralvoice <spiralvoice>
Group administrator
Sat 12 Nov 2005 08:32:03 AM UTC, original submission:  

Based on profiling (http://download.berlios.de/pub/mldonkey/pango/profiling/profiling_20051111.txt.bz2), the next CPU eater (beside memory management), is Set.cardinal.
Sources management uses the size of sources queues quite often (300 times/s in my test), and its complexity is O(n).

I created a version of set.ml that caches its size in a lazy int. Since adding and removing elements are the main (only ?) operations on sets used by mldonkey, I optimized those to also update the counter incrementally.

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-11-12 spiralvoice StatusNone Done
    Open/ClosedOpen Closed
2005-11-12 mlpango Attached File- Added set_with_cached_cardinal.patch, #5462

Back to the top

Powered by Savane 3.13-bb6a.
Corresponding source code