Skip to content

Commit

Permalink
Update static data sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 13, 2023
1 parent 6d03a92 commit 0bb8a59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ different ratios of ASCII to non-ASCII codepoints in the input data.

| | static storage | 0% nonascii | 1% | 10% | 100% nonascii |
|---|---|---|---|---|---|
| **`unicode-ident`** | 10.0 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns |
| **`unicode-ident`** | 10.1 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns |
| **`unicode-xid`** | 11.5 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns |
| **`ucd-trie`** | 10.2 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns |
| **`fst`** | 138 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns |
| **`fst`** | 139 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns |
| **`roaring`** | 66.1 K | 2.78 ns | 3.09 ns | 3.37 ns | 4.70 ns |

Source code for the benchmark is provided in the *bench* directory of this repo
Expand Down
8 changes: 4 additions & 4 deletions tests/static_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn test_size() {
+ size_of_val(&tables::TRIE_START)
+ size_of_val(&tables::TRIE_CONTINUE)
+ size_of_val(&tables::LEAF);
assert_eq!(10016, size);
assert_eq!(10080, size);
}

#[test]
Expand All @@ -23,7 +23,7 @@ fn test_xid_size() {
mod tables;

let size = size_of_val(tables::XID_START) + size_of_val(tables::XID_CONTINUE);
assert_eq!(11528, size);
assert_eq!(11544, size);

let _ = tables::BY_NAME;
}
Expand Down Expand Up @@ -70,7 +70,7 @@ fn test_trieset_size() {
+ size_of_val(tree3_level2)
+ size_of_val(tree3_level3);

assert_eq!(10208, start_size + continue_size);
assert_eq!(10200, start_size + continue_size);

let _ = trie::BY_NAME;
}
Expand All @@ -80,7 +80,7 @@ fn test_fst_size() {
let xid_start_fst = include_bytes!("fst/xid_start.fst");
let xid_continue_fst = include_bytes!("fst/xid_continue.fst");
let size = xid_start_fst.len() + xid_continue_fst.len();
assert_eq!(137749, size);
assert_eq!(138736, size);
}

#[test]
Expand Down

0 comments on commit 0bb8a59

Please sign in to comment.