Created
November 10, 2021 22:48
-
-
Save joseberlines/05bbdf28aaf97327e63ceedf381b8606 to your computer and use it in GitHub Desktop.
100000.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 100000 elements list | |
L=[{'name':'e'+str(i), 'explanation':'objection1','law':(),'CS':('..claim','..notclear')} for i in range(100000)] | |
next(item for item in L if item["name"] == "e3") | |
# 716 ns ± 62.5 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) | |
[d for d in L if d['name']=='e3'][0] | |
# 6.66 ms ± 520 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment