Commit fd2b247
[scanner/parser] Naturally avoid bounds check in SimpleToken.type
By making the constant array have size 256 we "naturally" avoid the
bounds check in SimpleToken.type.
Stats for 10 runs each before/after:
```
page-faults:u: -0.1222% +/- 0.0686% (-127.40 +/- 71.50)
instructions:u: -0.2589% +/- 0.0007% (-55273529.20 +/- 147748.67)
```
Stats for 100 runs each before/after:
```
msec task-clock:u: -1.6562% +/- 0.7810% (-71.89 +/- 33.90)
page-faults:u: -0.1251% +/- 0.0186% (-130.44 +/- 19.36)
cycles:u: -1.6881% +/- 0.8129% (-302264895.65 +/- 145560853.90)
instructions:u: -0.2593% +/- 0.0002% (-55345822.71 +/- 36070.85)
branch-misses:u: -5.9592% +/- 2.5980% (-4206550.69 +/- 1833947.73)
seconds time elapsed: -1.6470% +/- 0.7804% (-0.07 +/- 0.03)
seconds user: -1.6494% +/- 0.8506% (-0.07 +/- 0.04)
```
To my surprise this also reduced the size of the aot compiled CFE
by ~20 kb.
Change-Id: I149eda23a0b88f06953156021389bd85728e97ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387920
Commit-Queue: Jens Johansen <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Johnni Winther <[email protected]>1 parent 595662b commit fd2b247
File tree
1 file changed
+112
-5
lines changed1 file changed
+112
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1229 | 1232 | | |
1230 | 1233 | | |
1231 | 1234 | | |
| |||
1875 | 1878 | | |
1876 | 1879 | | |
1877 | 1880 | | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
1881 | 1886 | | |
1882 | 1887 | | |
1883 | 1888 | | |
| |||
2034 | 2039 | | |
2035 | 2040 | | |
2036 | 2041 | | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
2037 | 2144 | | |
0 commit comments