Skip to content

Commit 032b906

Browse files
Auto merge of #149887 - notriddle:stringdex/20251211, r=<try>
[PERF ONLY] rustdoc stringdex update
2 parents f520900 + 7585841 commit 032b906

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

‎Cargo.lock‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5358,8 +5358,7 @@ dependencies = [
53585358
[[package]]
53595359
name = "stringdex"
53605360
version = "0.0.3"
5361-
source = "registry+https://github.com/rust-lang/crates.io-index"
5362-
checksum = "556a6126952cb2f5150057c98a77cc6c771027dea2825bf7fa03d3d638b0a4f8"
5361+
source = "git+https://gitlab.com/notriddle/stringdex?rev=563240a4ffa22b57db94eda48a94652925a4f514#563240a4ffa22b57db94eda48a94652925a4f514"
53635362
dependencies = [
53645363
"stacker",
53655364
]

‎src/librustdoc/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rustdoc-json-types = { path = "../rustdoc-json-types" }
2121
serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
2323
smallvec = "1.8.1"
24-
stringdex = "=0.0.3"
24+
stringdex = { git = "https://gitlab.com/notriddle/stringdex", rev = "563240a4ffa22b57db94eda48a94652925a4f514" }
2525
tempfile = "3"
2626
threadpool = "1.8.1"
2727
tracing = "0.1"

‎src/librustdoc/html/static/js/stringdex.js‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ class RoaringBitmap {
5454
}
5555
this.consumed_len_bytes = pspecial - i;
5656
return this;
57+
} else if (u8array[i] > 0xe0) {
58+
// Special representation of tiny sets that are runs
59+
const lspecial = u8array[i] & 0x0f;
60+
this.keysAndCardinalities = new Uint8Array(lspecial * 4);
61+
i += 1;
62+
const key = u8array[i + 2] | (u8array[i + 3] << 8);
63+
const value = u8array[i] | (u8array[i + 1] << 8);
64+
const container = new RoaringBitmapRun(1, new Uint8Array(4));
65+
container.array[0] = value & 0xFF;
66+
container.array[1] = (value >> 8) & 0xFF;
67+
container.array[2] = lspecial - 1;
68+
this.containers.push(container);
69+
this.keysAndCardinalities[0] = key & 0xFF;
70+
this.keysAndCardinalities[1] = (key >> 8) & 0xFF;
71+
this.keysAndCardinalities[2] = lspecial - 1;
72+
this.consumed_len_bytes = 5;
73+
return this;
5774
} else if (u8array[i] < 0x3a) {
5875
// Special representation of tiny sets with arbitrary 32-bit integers
5976
const lspecial = u8array[i];
@@ -2282,7 +2299,7 @@ function loadDatabase(hooks) {
22822299
*/
22832300
class InlineNeighborsTree {
22842301
/**
2285-
* @param {Uint8Array<ArrayBuffer>} encoded
2302+
* @param {Uint8Array} encoded
22862303
* @param {number} start
22872304
*/
22882305
constructor(
@@ -2654,7 +2671,7 @@ function loadDatabase(hooks) {
26542671

26552672
/**
26562673
* @param {string} inputBase64
2657-
* @returns {[Uint8Array<ArrayBuffer>, SearchTree]}
2674+
* @returns {[Uint8Array, SearchTree]}
26582675
*/
26592676
function makeSearchTreeFromBase64(inputBase64) {
26602677
const input = makeUint8ArrayFromBase64(inputBase64);
@@ -3305,7 +3322,7 @@ if (typeof window !== "undefined") {
33053322
// eslint-disable-next-line max-len
33063323
// polyfill https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
33073324
/**
3308-
* @type {function(string): Uint8Array<ArrayBuffer>} base64
3325+
* @type {function(string): Uint8Array} base64
33093326
*/
33103327
//@ts-expect-error
33113328
const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 : (string => {
@@ -3318,7 +3335,7 @@ const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 :
33183335
return bytes;
33193336
});
33203337
/**
3321-
* @type {function(string): Uint8Array<ArrayBuffer>} base64
3338+
* @type {function(string): Uint8Array} base64
33223339
*/
33233340
//@ts-expect-error
33243341
const makeUint8ArrayFromHex = Uint8Array.fromHex ? Uint8Array.fromHex : (string => {

‎src/tools/tidy/src/extdeps.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const ALLOWED_SOURCES: &[&str] = &[
1111
r#""registry+https://github.com/rust-lang/crates.io-index""#,
1212
// This is `rust_team_data` used by `site` in src/tools/rustc-perf,
1313
r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#,
14+
// TMP
15+
r#""git+https://gitlab.com/notriddle/stringdex?rev=563240a4ffa22b57db94eda48a94652925a4f514#563240a4ffa22b57db94eda48a94652925a4f514""#,
1416
];
1517

1618
/// Checks for external package sources. `root` is the path to the directory that contains the

0 commit comments

Comments
 (0)