[Patches] [ python-Patches-1569291 ] Speed-up in array_repeat()

SourceForge.net noreply at sourceforge.net
Sun Oct 8 00:12:38 CEST 2006


Patches item #1569291, was opened at 2006-10-02 15:30
Message generated for change (Comment added) made by lskovlund
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1569291&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Lars Skovlund (lskovlund)
Assigned to: Nobody/Anonymous (nobody)
Summary: Speed-up in array_repeat()

Initial Comment:
Use iterative doubling when extending the old array.
This results in O(log n) calls to memcpy() instead of O(n).

----------------------------------------------------------------------

>Comment By: Lars Skovlund (lskovlund)
Date: 2006-10-08 00:12

Message:
Logged In: YES 
user_id=263372

I wrote this code for a university project I'm doing myself,
which involves initializing a *very* large array (it's a
remote memory system). It does help there, certainly; for
medium-sized arrays, the improvement would be negligable,
and for small ones it might even be worse.

If you mean, have I benchmarked it with other people's code,
no. I just thought I'd offer it to the community, since it
has certainly helped me.

----------------------------------------------------------------------

Comment By: Josiah Carlson (josiahcarlson)
Date: 2006-10-07 18:39

Message:
Logged In: YES 
user_id=341410

Have you benchmarked this for repeats found "in the wild" to
establish *observable* speedup for code that already exists?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1569291&group_id=5470


More information about the Patches mailing list