Logo
Explore Help
Register Sign In
fengqi/lv_micropython
1
0
Fork 0
You've already forked lv_micropython
Code Issues Pull Requests 1 Actions Packages Projects Releases Wiki Activity
lv_micropython/tests/internal_bench/from_iter-1-list_bound.py

9 lines
128 B
Python
Raw Normal View History

bench: Add tests for constructing various containers from iterator. Both "bound" (like, length known) and "unbound" (length unknown) are tested. All of list, tuple, bytes, bytesarray offer approximately the same performance, with "unbound" case being 30 times slower.
2014-06-19 21:44:33 +03:00
import bench
def test(num):
for i in iter(range(num//10000)):
l = [0] * 1000
l2 = list(l)
bench.run(test)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 198ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API