Skip to content

Commit fdbc8d0

Browse files
committed
rustdoc search: add performance note about searchIndexUnstable check
1 parent 5e8ebd5 commit fdbc8d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustdoc/html/static/js/search.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,6 +3291,12 @@ class DocSearch {
32913291
}
32923292

32933293
// sort unstable items later
3294+
// FIXME: there is some doubt if this is the most effecient way to implement this.
3295+
// alternative options include:
3296+
// * put is_unstable on each item when the index is built.
3297+
// increases memory usage but avoids a hashmap lookup.
3298+
// * put is_unstable on each item before sorting.
3299+
// better worst case performance but worse average case performance.
32943300
a = Number(
32953301
// @ts-expect-error
32963302
this.searchIndexUnstable.get(aaa.item.crate).contains(aaa.item.bitIndex),

0 commit comments

Comments
 (0)