Message353207
dict.get() is a method call wheras "key in dict" and "dict[key]" are operators. Method calls are still slower than operators, even after past optimizations. For example, when dict.get was converted to METH_FASTCALL, it was around 20 ns faster:
https://vstinner.github.io/fastcall-microbenchmarks.html
See also closed bpo-17170 "string method lookup is too slow". |
|
Date |
User |
Action |
Args |
2019-09-25 14:46:22 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka, benspiller |
2019-09-25 14:46:22 | vstinner | set | messageid: <1569422782.61.0.0498799017542.issue38278@roundup.psfhosted.org> |
2019-09-25 14:46:22 | vstinner | link | issue38278 messages |
2019-09-25 14:46:22 | vstinner | create | |
|