Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bpgergo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
bpgergo
15y ago
Can you explain why `[:]` is faster for small list (10 elements) but `list()` is faster for larger list (100000 elements). ~$ python -S -mtimeit -s "a = list(range(10))" "a[:]" 1000000 loops, best of 3: 0.198 usec per loop ~$