Commit 354b1fa
refactor(core): improve
In this commit, we improve branching in the `stringify` function, which is widely used by the framework, and add additional comments for clarification. Benchmark results of the old and new implementations (using `slice` makes it slightly faster) are as follows:
```
stringify (old version) x 117,945,419 ops/sec ±5.25% (55 runs sampled)
stringify (new version) x 136,692,820 ops/sec ±4.82% (56 runs sampled)
```
PR Close #59745stringify (#59745)1 parent 236a623 commit 354b1fa
1 file changed
+9
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
31 | 28 | | |
32 | | - | |
33 | | - | |
| 29 | + | |
| 30 | + | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
37 | | - | |
| 33 | + | |
| 34 | + | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
| |||
0 commit comments