Commit 3a18e14
bors-servo
Auto merge of #175 - aidanhs:aphs-faster-cmp, r=SimonSapin
Make cmp massively faster for inline atoms
This is a big deal if you're putting atoms inside a btreeset since it does a lot of cmp operations.
It's more unsafe, but
1. the only thing that constructs `Inline` atoms should be the `string-cache` code (which I've been utilising fairly heavily)
2. if `string-cache` code *isn't* the only thing constructing atoms, `Dynamic` atoms are wildly unsafe since they contain pointers
3. since the creation of `Inline` atoms is only dependent on length of string (not content) you can exhaustively check correctness just by inlining and derefing strings from `"a"` to `"aaaaaaa"`. I can add an explicit test for this if you like.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/string-cache/175)
<!-- Reviewable:end -->1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
0 commit comments