Antonio Scandurra
4431ef1870
Speed up point translation in the Rope (#19913)
This pull request introduces an index of Unicode codepoints, newlines
and UTF-16 codepoints.
Benchmarks worth a thousand words:
```
push/4096 time: [467.06 µs 470.07 µs 473.24 µs]
thrpt: [8.2543 MiB/s 8.3100 MiB/s 8.3635 MiB/s]
change:
time: [-4.1462% -3.0990% -2.0527%] (p = 0.00 < 0.05)
thrpt: [+2.0957% +3.1981% +4.3255%]
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
2 (2.00%) high mild
push/65536 time: [1.4650 ms 1.4796 ms 1.4922 ms]
thrpt: [41.885 MiB/s 42.242 MiB/s 42.664 MiB/s]
change:
time: [-3.2871% -2.3489% -1.4555%] (p = 0.00 < 0.05)
thrpt: [+1.4770% +2.4054% +3.3988%]
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) low severe
3 (3.00%) low mild
append/4096 time: [729.00 ns 730.57 ns 732.14 ns]
thrpt: [5.2103 GiB/s 5.2215 GiB/s 5.2327 GiB/s]
change:
time: [-81.884% -81.836% -81.790%] (p = 0.00 < 0.05)
thrpt: [+449.16% +450.53% +452.01%]
Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) low mild
6 (6.00%) high mild
2 (2.00%) high severe
append/65536 time: [504.44 ns 505.58 ns 506.77 ns]
thrpt: [120.44 GiB/s 120.72 GiB/s 121.00 GiB/s]
change:
time: [-94.833% -94.807% -94.782%] (p = 0.00 < 0.05)
thrpt: [+1816.3% +1825.8% +1835.5%]
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
slice/4096 time: [29.661 µs 29.733 µs 29.816 µs]
thrpt: [131.01 MiB/s 131.38 MiB/s 131.70 MiB/s]
change:
time: [-48.833% -48.533% -48.230%] (p = 0.00 < 0.05)
thrpt: [+93.161% +94.298% +95.440%]
Performance has improved.
slice/65536 time: [588.00 µs 590.22 µs 592.17 µs]
thrpt: [105.54 MiB/s 105.89 MiB/s 106.29 MiB/s]
change:
time: [-45.599% -45.347% -45.099%] (p = 0.00 < 0.05)
thrpt: [+82.147% +82.971% +83.821%]
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low severe
1 (1.00%) high mild
bytes_in_range/4096 time: [3.8630 µs 3.8811 µs 3.8994 µs]
thrpt: [1001.8 MiB/s 1006.5 MiB/s 1011.2 MiB/s]
change:
time: [+0.0600% +0.6000% +1.1833%] (p = 0.03 < 0.05)
thrpt: [-1.1695% -0.5964% -0.0600%]
Change within noise threshold.
bytes_in_range/65536 time: [98.178 µs 98.545 µs 98.931 µs]
thrpt: [631.75 MiB/s 634.23 MiB/s 636.60 MiB/s]
change:
time: [-0.6513% +0.7537% +2.2265%] (p = 0.30 > 0.05)
thrpt: [-2.1780% -0.7481% +0.6555%]
No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
8 (8.00%) high mild
3 (3.00%) high severe
chars/4096 time: [878.91 ns 879.45 ns 880.06 ns]
thrpt: [4.3346 GiB/s 4.3376 GiB/s 4.3403 GiB/s]
change:
time: [+9.1679% +9.4000% +9.6304%] (p = 0.00 < 0.05)
thrpt: [-8.7844% -8.5923% -8.3979%]
Performance has regressed.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) low severe
1 (1.00%) low mild
3 (3.00%) high mild
3 (3.00%) high severe
chars/65536 time: [15.615 µs 15.691 µs 15.757 µs]
thrpt: [3.8735 GiB/s 3.8899 GiB/s 3.9087 GiB/s]
change:
time: [+5.4902% +5.9345% +6.4044%] (p = 0.00 < 0.05)
thrpt: [-6.0190% -5.6021% -5.2045%]
Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) low mild
clip_point/4096 time: [29.677 µs 29.835 µs 30.019 µs]
thrpt: [130.13 MiB/s 130.93 MiB/s 131.63 MiB/s]
change:
time: [-46.306% -45.866% -45.436%] (p = 0.00 < 0.05)
thrpt: [+83.272% +84.728% +86.240%]
Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe
clip_point/65536 time: [1.5933 ms 1.6116 ms 1.6311 ms]
thrpt: [38.318 MiB/s 38.782 MiB/s 39.226 MiB/s]
change:
time: [-30.388% -29.598% -28.717%] (p = 0.00 < 0.05)
thrpt: [+40.286% +42.040% +43.653%]
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s
point_to_offset/4096 time: [14.493 µs 14.591 µs 14.707 µs]
thrpt: [265.61 MiB/s 267.72 MiB/s 269.52 MiB/s]
change:
time: [-71.990% -71.787% -71.588%] (p = 0.00 < 0.05)
thrpt: [+251.96% +254.45% +257.01%]
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
5 (5.00%) high mild
4 (4.00%) high severe
point_to_offset/65536 time: [700.72 µs 713.75 µs 727.26 µs]
thrpt: [85.939 MiB/s 87.566 MiB/s 89.194 MiB/s]
change:
time: [-61.778% -61.015% -60.256%] (p = 0.00 < 0.05)
thrpt: [+151.61% +156.51% +161.63%]
Performance has improved.
```
Calling `Rope::chars` got slightly slower but I don't think it's a big
issue (we don't really call `chars` for an entire `Rope`).
In a future pull request, I want to use the tab index (which we're not
yet using) and the char index to make `TabMap` a lot faster.
Release Notes:
- N/A
2024-10-30 10:59:03 +01:00
..
2024-10-11 12:33:08 +02:00
2024-10-23 15:13:52 -04:00
2024-09-13 17:44:16 -04:00
2024-10-29 13:57:33 -04:00
2024-10-23 21:26:50 -04:00
2024-09-16 21:55:32 -06:00
2024-10-29 11:32:55 +01:00
2024-09-27 11:06:48 +02:00
2024-10-24 12:14:03 -06:00
2024-10-27 19:44:21 -07:00
2024-10-24 12:14:03 -06:00
2024-10-29 09:52:54 +01:00
2024-10-07 16:28:33 -07:00
2024-10-29 17:24:10 +02:00
2024-10-28 12:55:55 -07:00
2024-09-06 11:58:39 +02:00
2024-09-06 11:58:39 +02:00
2024-10-28 10:37:58 -04:00
2024-10-28 12:55:55 -07:00
2024-10-07 01:29:58 +02:00
2024-10-24 12:14:03 -06:00
2024-10-28 12:55:55 -07:00
2024-10-29 13:47:43 -07:00
2024-10-11 14:58:58 -07:00
2024-10-28 15:34:03 +01:00
2024-09-13 14:49:50 -04:00
2024-10-11 14:58:58 -07:00
2024-10-15 23:32:44 -07:00
2024-10-29 11:30:07 -07:00
2024-09-26 14:01:05 -06:00
2024-10-28 17:21:41 -07:00
2024-10-27 15:50:54 -07:00
2024-10-29 16:19:05 -04:00
2024-10-29 17:24:32 -04:00
2024-09-27 13:48:37 -07:00
2024-09-26 14:01:05 -06:00
2024-10-29 23:54:00 -07:00
2024-09-13 17:44:16 -04:00
2024-09-06 11:58:39 +02:00
2024-10-15 23:32:44 -07:00
2024-10-28 12:55:55 -07:00
2024-09-06 11:58:39 +02:00
2024-10-21 13:05:30 +03:00
2024-09-06 11:58:39 +02:00
2024-10-29 13:47:43 -07:00
2024-10-29 11:22:41 -06:00
2024-09-10 15:51:01 -04:00
2024-10-28 21:55:38 +01:00
2024-10-29 12:35:34 -06:00
2024-09-06 11:58:39 +02:00
2024-10-11 14:58:58 -07:00
2024-10-26 03:32:22 +03:00
2024-10-21 15:28:22 -06:00
2024-10-28 12:55:55 -07:00
2024-10-25 16:47:44 -06:00
2024-09-25 12:45:41 -07:00
2024-09-29 10:30:48 -06:00
2024-09-27 00:36:17 -06:00
2024-09-26 14:01:05 -06:00
2024-09-27 13:48:37 -07:00
2024-10-29 09:52:36 +01:00
2024-10-21 13:05:30 +03:00
2024-10-28 17:21:41 -07:00
2024-10-29 17:24:10 +02:00
2024-10-29 13:02:32 -07:00
2024-10-29 09:52:36 +01:00
2024-09-16 16:20:17 -06:00
2024-10-29 23:54:00 -07:00
2024-09-27 11:06:48 +02:00
2024-10-29 13:38:30 +01:00
2024-09-06 11:58:39 +02:00
2024-10-29 16:43:34 -04:00
2024-10-29 23:54:00 -07:00
2024-10-29 11:30:07 -07:00
2024-10-18 09:57:00 -07:00
2024-09-10 11:16:27 -04:00
2024-10-30 10:59:03 +01:00
2024-10-27 15:50:54 -07:00
2024-10-28 12:55:55 -07:00
2024-10-23 12:34:51 -04:00
2024-10-07 01:29:58 +02:00
2024-10-27 15:50:54 -07:00
2024-09-06 11:58:39 +02:00
2024-10-07 01:29:58 +02:00
2024-10-02 13:27:16 +02:00
2024-10-29 12:30:55 -07:00
2024-10-05 12:58:45 +03:00
2024-09-06 11:58:39 +02:00
2024-10-24 13:07:20 +02:00
2024-10-30 10:59:03 +01:00
2024-10-23 10:36:14 +03:00
2024-09-06 11:58:39 +02:00
2024-10-04 10:37:41 -04:00
2024-10-23 00:14:43 -07:00
2024-10-28 17:21:41 -07:00
2024-10-29 23:54:00 -07:00
2024-10-24 13:52:26 +02:00
2024-10-28 12:55:55 -07:00
2024-10-17 13:18:13 -04:00
2024-10-29 22:30:58 -04:00
2024-09-07 02:36:55 +02:00
2024-09-06 11:58:39 +02:00
2024-10-29 12:13:21 +01:00
2024-10-28 15:34:03 +01:00
2024-10-29 11:30:07 -07:00
2024-09-13 16:45:16 -04:00
2024-10-27 15:50:54 -07:00
2024-10-29 12:27:30 +01:00
2024-10-25 16:47:44 -06:00
2024-10-28 12:55:55 -07:00
2024-10-29 21:16:45 -04:00
2024-10-29 12:31:51 -04:00
2024-10-29 23:54:00 -07:00
2024-10-15 23:32:44 -07:00