ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Surprising (for me) benchmark results...
by Toby Dickenson other posts by this author
May 3 2001 7:24PM messages near this date
Re: Surprising (for me) benchmark results... | Re: Surprising (for me) benchmark results...
"Alex Martelli" <aleaxit@[...].com>  wrote:

> I measured on *large* values of N -- I don't recall the exact
> numbers, but they didn't seem to matter much: allocating by
> the current strategy OR by geometrical growth (say N'=100+1.5N,
> when the current allocation of N items must grow to a new size
> N') produced very similar results, preallocating the whole
> caboodle in advance always gave substantial advantage.
> 
> That was on Windows platforms, and for Python 2.0, by the way.
> Maybe performance behaves otherwise with different allocators.

All win32 platforms, linux, and possibly some other platforms too,
have special provision for malloc of large blocks. realloc is
implemented by remapping VMM pages, rather than copying physical
memory.

list.append is definitely O(n*n) in theory, but with a constant factor
small enough that you never see it in practice.



Toby Dickenson
tdickenson@[...].com
-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Courageous
Toby Dickenson
Alex Martelli
Courageous
Alex Martelli
Courageous
Daniel Berlin
Tim Peters

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved