about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbinarycat <binarycat@envs.net>2025-08-08 11:55:00 -0500
committerbinarycat <binarycat@envs.net>2025-08-08 11:55:00 -0500
commitfdbc8d08a63a3d34b7aebabb2f18a768462a98c4 (patch)
tree55bbe54d1cd4acfff5a736477b525012453363d7 /src
parent5e8ebd5ecd8546591a6707ac9e1a3b8a64c72f76 (diff)
downloadrust-fdbc8d08a63a3d34b7aebabb2f18a768462a98c4.tar.gz
rust-fdbc8d08a63a3d34b7aebabb2f18a768462a98c4.zip
rustdoc search: add performance note about searchIndexUnstable check
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/js/search.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index da15433622a..1ed789f63d5 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -3291,6 +3291,12 @@ class DocSearch {
                 }
 
                 // sort unstable items later
+                // FIXME: there is some doubt if this is the most effecient way to implement this.
+                // alternative options include:
+                // * put is_unstable on each item when the index is built.
+                //   increases memory usage but avoids a hashmap lookup.
+                // * put is_unstable on each item before sorting.
+                //   better worst case performance but worse average case performance.
                 a = Number(
                     // @ts-expect-error
                     this.searchIndexUnstable.get(aaa.item.crate).contains(aaa.item.bitIndex),