Created on 2017-12-19 19:54 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 4932 | merged | pitrou, 2017-12-19 19:56 | |
| Messages (5) | |||
|---|---|---|---|
| msg308674 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2017-12-19 19:54 | |
MRO computation involves a complicated merge calculation over several lists. But, for the simple (common) case where a class has a single base, the computation could be much simpler: take the base's MRO and prepend the derived class. |
|||
| msg308675 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2017-12-19 20:00 | |
Benchmarks: * before: $ ./env-orig/bin/pyperf timeit "class Test: pass" ..................... Mean +- std dev: 9.51 us +- 0.17 us * after: $ ./env/bin/pyperf timeit "class Test: pass" ..................... Mean +- std dev: 8.89 us +- 0.09 us |
|||
| msg308733 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-12-20 14:06 | |
LGTM in general. But mro() returns a list. "class Test: pass" is a trivial case. What are results if the class has a parent? |
|||
| msg308734 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2017-12-20 14:15 | |
Benchmarks with a parent: * Before: $ ./env-orig/bin/pyperf timeit -s "from unittest import TestCase" "class Test(TestCase): pass" ..................... Mean +- std dev: 10.4 us +- 0.1 us * After: $ ./env/bin/pyperf timeit -s "from unittest import TestCase" "class Test(TestCase): pass" ..................... Mean +- std dev: 9.89 us +- 0.12 us |
|||
| msg308737 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2017-12-20 14:58 | |
New changeset 1f1a34c3145781628e10534440017b3b43211a60 by Antoine Pitrou in branch 'master': bpo-32379: Faster MRO computation for single inheritance (#4932) https://github.com/python/cpython/commit/1f1a34c3145781628e10534440017b3b43211a60 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:55 | admin | set | github: 76560 |
| 2017-12-20 14:58:51 | pitrou | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-12-20 14:58:23 | pitrou | set | messages: + msg308737 |
| 2017-12-20 14:15:19 | pitrou | set | messages: + msg308734 |
| 2017-12-20 14:06:11 | serhiy.storchaka | set | messages: + msg308733 |
| 2017-12-19 20:00:20 | pitrou | set | messages: + msg308675 |
| 2017-12-19 19:56:53 | pitrou | set | nosy:
+ vstinner, methane, serhiy.storchaka |
| 2017-12-19 19:56:32 | pitrou | set | keywords:
+ patch stage: patch review pull_requests: + pull_request4825 |
| 2017-12-19 19:54:59 | pitrou | create | |