[BitTorrent] BT2 & hash trees - leaf size benchmarked

Olaf van der Spek OvdSpek at LIACS.NL
Sat Jul 24 05:17:57 EDT 2004


> The attached benchmark uses a stack-based system for storing hashes and
> only retains data as needed to find the root hash; as such, it is not
> appropriate for the actual client, but would be useful for a
> "makemetafile" function and also gives some idea how much overhead might
> be needed for generating hashes for chunks.
>
> Running stack_based_sha_tree.test() returned (for me, YMMV):
> { leaf_node_size seconds_to_hash_1GB }
>  >>> Script1.test()
> 512 48.3537885402
> 1024 30.8940586024
> 2048 21.9012997462
> 4096 17.3593610361
> 8192 15.0708657106
> 16384 13.928948791
> 32768 13.4034861973
>
> Note that using a 1K leaf size uses more than 2X the CPU as using a 16K
> leaf size.  Given this, I'd have to recommend a leaf size of 4K at the
> smallest, and larger would be better.

So in the worst case (1 vs 16 kb) you'd be 'wasting' less than 17 s, spread
over the entire download time?
Suppose you're indeed downloading one gb in two hour (almost 150 kb/s), then
CPU usage would be 0.2 % higher on average.
Is that a huge overhead?



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/dkFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
    BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the BitTorrent mailing list