Commit 6a3ee53
[parser] Don't use late variables in the scanner
The usage of late variables become an access, a comparison to a marker,
and a conditional jump.
Having it be non-null and non-late it's just an access.
Running aot compiled scanner benchmarks on
pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart with `--bytes`
gives:
```
N Min Max Median Avg Stddev
x 25 149.49816 154.67461 153.12174 153.03484 1.2430919
+ 25 153.82654 157.77314 156.45323 156.15451 1.1301418
Difference at 95.0% confidence
3.11967 +/- 0.675708
2.03853% +/- 0.441538%
(Student's t, pooled s = 1.18796)
```
And running the benchmarker with `--cache --silent --iterations=50` on
the scanner benchmark with the same parameters gives:
```
Comparing snapshot 1 with snapshot 2
msec task-clock:u: -1.9158% +/- 0.3843% (-48.87 +/- 9.80)
cycles:u: -1.9652% +/- 0.3719% (-218241604.28 +/- 41302487.04)
instructions:u: -0.4735% +/- 0.0000% (-116299496.56 +/- 182.39)
seconds time elapsed: -1.9132% +/- 0.3834% (-0.05 +/- 0.01)
seconds user: -2.0074% +/- 0.4009% (-0.05 +/- 0.01)
Comparing snapshot 1 with snapshot 2
msec task-clock:u: -2.1237% +/- 0.2726% (-54.21 +/- 6.96)
L1-icache-load-misses: -6.2140% +/- 3.3961% (-268165.40 +/- 146560.98)
LLC-loads: -0.5702% +/- 0.4680% (-6613.36 +/- 5428.54)
seconds time elapsed: -2.1219% +/- 0.2728% (-0.05 +/- 0.01)
seconds user: -2.0997% +/- 0.2793% (-0.05 +/- 0.01)
```
Change-Id: I38e076a2e8442e3313075eaa600114f664eb415d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411640
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Jens Johansen <[email protected]>1 parent a9ab52b commit 6a3ee53
File tree
1 file changed
+25
-11
lines changed1 file changed
+25
-11
lines changedLines changed: 25 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
145 | 153 | | |
146 | 154 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
156 | 169 | | |
157 | 170 | | |
158 | 171 | | |
159 | 172 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
163 | 177 | | |
164 | 178 | | |
165 | 179 | | |
| |||
0 commit comments