Gregory Petrosyan wrote:
> Oh, by the way, is there any documentation about time of execution of
> standard functions?
Nope.  The reason is (A) that's a lot of work, (B) there are too many
caveats in practice to make such information useful, (C) any such spec
might corner the possible implementations in a later version.

 > is len(list) O(1) or O(n), etc) and is there any C version of decimal?
len(list) is O(1), list[n] is O(1), and if you (and others) continue
using decimal and it gets popular, rest assured that it will get faster.
Also, dictionary access is \Theta(1) (but only because you run on
machines with quite finite limitations).

The general Python rule when writing is "only worry about fast enough"
and optimize only after the code works and it needs to be faster.
Further, to determine speed, measure (use the timeit module) rather than
guess.  Nobody's intuition is great WRT performance, and you'd be
shocked at the number of hours people spend speeding up a chunk of code
that cannot possibly substantially affect an applications performance.

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to