URL:
<http://savannah.nongnu.org/patch/?func=detailitem&item_id=4613>
Summary: Optimizing Set.cardinal
Project: mldonkey, a multi-networks file-sharing client
Submitted by: mlpango
Submitted on: sam 12.11.2005 à 09:32
Category: None
Priority: 5 - Normal
Status: None
Assigned to: spiralvoice
Originator Email:
Open/Closed: Open
_______________________________________________________
Details:
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.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: sam 12.11.2005 à 09:32 Name: set_with_cached_cardinal.patch Size:
20,81Ko By: mlpango
<http://savannah.nongnu.org/patch/download.php?item_id=4613&item_file_id=5462>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?func=detailitem&item_id=4613>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/
_______________________________________________
Mldonkey-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/mldonkey-users