Skip to content

Commit

Permalink
Merge pull request #25 from dtolnay/unicode
Browse files Browse the repository at this point in the history
Update to Unicode 15.1.0
  • Loading branch information
dtolnay authored Sep 13, 2023
2 parents 0eb7abf + 0bb8a59 commit b4e9dd5
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 158 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
18 changes: 11 additions & 7 deletions src/tables.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tests/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ fn compare_all_implementations() {
let thought_to_be_continue = unicode_ident::is_xid_continue(ch);

// unicode-xid
// FIXME: unicode-xid does not support Unicode 15.1.0 yet.
/*
assert_eq!(
thought_to_be_start,
unicode_xid::UnicodeXID::is_xid_start(ch),
Expand All @@ -24,6 +26,7 @@ fn compare_all_implementations() {
unicode_xid::UnicodeXID::is_xid_continue(ch),
"{ch:?}",
);
*/

// ucd-trie
assert_eq!(
Expand Down
Binary file modified tests/fst/xid_continue.fst
Binary file not shown.
Binary file modified tests/fst/xid_start.fst
Binary file not shown.
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
Loading

0 comments on commit b4e9dd5

Please sign in to comment.