Commit 9c48b9d
committed
isKeyword optimization for non-keyword fast path.
- Add non-keyword fast path check if first char is '@'.
- Avoids full `switch` for data that can't be a keyword.
- Array access will just be undefined for empty string.
- Performance change depends on data shape, format, and processing
algorithm workload. Some synthetic tests with ~80% non-keywords could
see 1-3%+ overall increase.1 parent 28fe0ff commit 9c48b9d
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
| 1159 | + | |
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
| |||
0 commit comments