Commit 8deb8bc
authored
This makes the Tier 2 interpreter a little faster.
I calculated by about 3%,
though I hesitate to claim an exact number.
This starts by doubling the trace size limit (to 512),
making it more likely that loops fit in a trace.
The rest of the approach is to only load
`oparg` and `operand` in cases that use them.
The code generator know when these are used.
For `oparg`, it will conditionally emit
```
oparg = CURRENT_OPARG();
```
at the top of the case block.
(The `oparg` variable may be referenced multiple times
by the instructions code block, so it must be in a variable.)
For `operand`, it will use `CURRENT_OPERAND()` directly
instead of referencing the `operand` variable,
which no longer exists.
(There is only one place where this will be used.)
1 parent c4c6321 commit 8deb8bc
7 files changed
Lines changed: 131 additions & 33 deletions
File tree
- Include/internal
- Misc/NEWS.d/next/Core and Builtins
- Python
- Tools/cases_generator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
998 | 997 | | |
999 | 998 | | |
1000 | 999 | | |
1001 | 1000 | | |
1002 | 1001 | | |
1003 | 1002 | | |
1004 | | - | |
1005 | | - | |
1006 | 1003 | | |
1007 | 1004 | | |
1008 | 1005 | | |
1009 | 1006 | | |
1010 | | - | |
1011 | | - | |
| 1007 | + | |
| 1008 | + | |
1012 | 1009 | | |
1013 | 1010 | | |
1014 | 1011 | | |
| |||
1025 | 1022 | | |
1026 | 1023 | | |
1027 | 1024 | | |
1028 | | - | |
1029 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1030 | 1028 | | |
1031 | 1029 | | |
1032 | 1030 | | |
| |||
1055 | 1053 | | |
1056 | 1054 | | |
1057 | 1055 | | |
1058 | | - | |
| 1056 | + | |
1059 | 1057 | | |
1060 | 1058 | | |
1061 | 1059 | | |
| |||
1068 | 1066 | | |
1069 | 1067 | | |
1070 | 1068 | | |
1071 | | - | |
| 1069 | + | |
1072 | 1070 | | |
1073 | 1071 | | |
1074 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
0 commit comments