GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — [mypyc] Add primitives for list and variable-length tuple equality by Jahongir-Qurbonov · Pull Request #22410 · python/mypy Conversation
|
| Case | list |
tuple |
|---|---|---|
| Empty | 0.048s -> 0.038s | 0.049s -> 0.038s |
| Length 3, equal | 0.056s -> 0.047s | 0.053s -> 0.043s |
| Length 3, equal, distinct item objects | 0.102s -> 0.108s | 0.088s -> 0.090s |
| Different lengths | 0.049s -> 0.041s | 0.053s -> 0.042s |
| First item differs | 0.065s -> 0.062s | 0.062s -> 0.058s |
| Length 20, equal | 0.101s -> 0.078s | 0.083s -> 0.067s |
Part of mypyc/mypyc#644.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Use specialized C functions for == and != when both operands are lists or both are variable-length tuples, instead of PyObject_RichCompare followed by a truth test of the result. Subclasses use the generic path.
Tuple equality now compares items even if the lengths differ, like CPython, since item comparisons can have side effects or raise exceptions. Pass the comparison operator to the C functions, so that != on list and tuple subclasses calls __ne__ instead of negating the result of __eq__.
87ada72 to
25d80a4
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.