📄 libunicode_ident-61533c72d8f4e5f7.rmeta
/home/palash/git/iron_learn/target/debug/deps/libunicode_ident-61533c72d8f4e5f7.rmeta
Language: rmeta • Lines: 272
rust
�~#rustc 1.92.0 (ded5c06cf 2025-12-08)��١�	�T�6a��D�
-5080178c80bf7a93��**�٭T��HО�9�-3e2e950d4bac10b5���ZERO�is_xid_start�is_xid_continue�tables�Align8�
��Align64�
��UNICODE_VERSION�ASCII_START�ASCII_CONTINUE�CHUNK�
TRIE_START�
TRIE_CONTINUE�LEAF�T�
�������5���d�*_���!��������G�$�$!0x7fffffe07fffffe0000000000000000���!�����������J�$�$!0x7fffffe87fffffe03ff000000000000��
@��#�,�$64��
��+�6=411�$�
�+�6=1793�$�q
�� +�6=7808���
�)��|o�\>��
a�
ho}
�
���
��
���
�
&���LGs�@|�
^�
elz
�
�����
��
��|�\�t�]�\�]�,�]�$�]�l�]	�T�]
��d��� [![github]](https://github.com/dtolnay/unicode-ident)&ensp;[![crates-io]](https://crates.io/crates/unicode-ident)&ensp;[![docs-rs]](https://docs.rs/unicode-ident)�����jg [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github���nk [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust���mj [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs���D� <br>�����NK Implementation of [Unicode Standard Annex #31][tr31] for determining which���@= `char` values are valid in programming language identifiers.�����1. [tr31]: https://www.unicode.org/reports/tr31/�����NK This crate is a better optimized implementation of the older `unicode-xid`���LI crate. This crate uses less static storage, and is able to classify both���PM ASCII and non-ASCII codepoints with better performance, 6&times; faster than��� `unicode-xid`.���D������  ## Comparison of performance�����JG The following table shows a comparison between five Unicode identifier��� implementations.�����$! - `unicode-ident` is this crate;���	IF - [`unicode-xid`] is a widely used crate run by the "unicode-rs" org;���	C@ - `ucd-trie` and `fst` are two data structures supported by the��
   [`ucd-generate`] tool;���
=: - [`roaring`] is a Rust implementation of Roaring bitmap.��
���
PM The *static storage* column shows the total size of `static` tables that the���=: crate bakes into your binary, measured in 1000s of bytes.�����JG The remaining columns show the **cost per call** to evaluate whether a���GD single `char` has the XID\_Start or XID\_Continue Unicode property,���
MJ comparing across different ratios of ASCII to non-ASCII codepoints in the�|�
 input data.��
���>; [`unicode-xid`]: https://github.com/unicode-rs/unicode-xid���@= [`ucd-generate`]: https://github.com/BurntSushi/ucd-generate���<9 [`roaring`]: https://github.com/RoaringBitmap/roaring-rs�����A> | | static storage | 0% nonascii | 1% | 10% | 100% nonascii |�� |---|---|---|---|---|---|���LI | **`unicode-ident`** | 10.3 K | 0.41 ns | 0.44 ns | 0.44 ns | 0.93 ns |���JG | **`unicode-xid`** | 12.0 K | 2.43 ns | 2.50 ns | 2.85 ns | 8.65 ns |���GD | **`ucd-trie`** | 10.4 K | 1.28 ns | 1.25 ns | 1.20 ns | 1.97 ns |���A> | **`fst`** | 144 K | 50.9 ns | 51.0 ns | 48.5 ns | 26.7 ns |���FC | **`roaring`** | 66.1 K | 4.28 ns | 4.22 ns | 4.25 ns | 4.61 ns |�����NK Source code for the benchmark is provided in the *bench* directory of this���:7 repo and may be repeated by running `cargo criterion`.���D������$! ## Comparison of data structures����� #### unicode-xid�����OL They use a sorted array of character ranges, and do a binary search to look���B? up whether a given character lands inside one of those ranges.���\� ```rust���" # const _: &str = stringify! {���63 static XID_Continue_table: [(char, char); 763] = [���%"     ('\u{30}', '\u{39}'),  // 0-9���%"     ('\u{41}', '\u{5a}'),  // A-Z�<� # "�\�     …�<��(��#      ('\u{e0100}', '\u{e01ef}'),�4� ];�D� # };�<� ```�����LI The static storage used by this data structure scales with the number of���LI contiguous ranges of identifier codepoints in Unicode. Every table entry���LI consumes 8 bytes, because it consists of a pair of 32-bit `char` values.�����IF In some ranges of the Unicode codepoint space, this is quite a sparse���KH representation &ndash; there are some ranges where tens of thousands of���MJ adjacent codepoints are all valid identifier characters. In other places,���LI the representation is quite inefficient. A characater like `µ` (U+00B5)���LI which is surrounded by non-identifier codepoints consumes 64 bits in the���:7 table, while it would be just 1 bit in a dense bitmap.�����NK On a system with 64-byte cache lines, binary searching the table touches 7���FC cache lines on average. Each cache line fits only 8 table entries.���NK Additionally, the branching performed during the binary search is probably���1. mostly unpredictable to the branch predictor.�����MJ Overall, the crate ends up being about 6&times; slower on non-ASCII input��� " compared to the fastest crate.�� ��� NK A potential improvement would be to pack the table entries more compactly.���!OL Rust's `char` type is a 21-bit integer padded to 32 bits, which means every���!LI table entry is holding 22 bits of wasted space, adding up to 3.9 K. They���"MJ could instead fit every table entry into 6 bytes, leaving out some of the���#PM padding, for a 25% improvement in space used. With some cleverness it may be���#KH possible to fit in 5 bytes or even 4 bytes by storing a low char and an���$NK extent, instead of low char and high char. I don't expect that performance���$PM would improve much but this could be the most efficient for space across all���%30 the libraries, needing only about 7 K to store.��%���% #### ucd-trie��&���&KH Their data structure is a compressed trie set specifically tailored for���&@= Unicode codepoints. The design is credited to Raph Levien in�ܜ' [rust-lang/rust#33098].��'���'HE [rust-lang/rust#33098]: https://github.com/rust-lang/rust/pull/33098��(�\�(�'ĕ( pub struct TrieSet {���()&     tree1_level1: &'static [u64; 32],���()&     tree2_level1: &'static [u8; 992],���)%"     tree2_level2: &'static [u64],���))&     tree3_level1: &'static [u8; 256],���)$!     tree3_level2: &'static [u8],���)%"     tree3_level3: &'static [u64],�,�* }�<�*�)�*���*PM It represents codepoint sets using a trie to achieve prefix compression. The���+KH final states of the trie are embedded in leaves or "chunks", where each���+NK chunk is a 64-bit integer. Each bit position of the integer corresponds to���,MJ whether a particular codepoint is in the set or not. These chunks are not���,OL just a compact representation of the final states of the trie, but are also���-IF a form of suffix compression. In particular, if multiple ranges of 64���.PM contiguous codepoints have the same Unicode properties, then they all map to���.2/ the same chunk in the final level of the trie.��/���/NK Being tailored for Unicode codepoints, this trie is partitioned into three���/OL disjoint sets: tree1, tree2, tree3. The first set corresponds to codepoints���0FC \[0, 0x800), the second \[0x800, 0x10000) and the third \[0x10000,���0NK 0x110000). These partitions conveniently correspond to the space of 1 or 2���1MJ byte UTF-8 encoded codepoints, 3 byte UTF-8 encoded codepoints and 4 byte���2+( UTF-8 encoded codepoints, respectively.��2���2OL Lookups in this data structure are significantly more efficient than binary���3PM search. A lookup touches either 1, 2, or 3 cache lines based on which of the���3&# trie partitions is being accessed.��4���4PM One possible performance improvement would be for this crate to expose a way���4LI to query based on a UTF-8 encoded string, returning the Unicode property���5PM corresponding to the first character in the string. Without such an API, the���5NK caller is required to tokenize their UTF-8 encoded input data into `char`,���6MJ hand the `char` into `ucd-trie`, only for `ucd-trie` to undo that work by���7OL converting back into the variable-length representation for trie traversal.��7�d�7	 #### fst��7���7LI Uses a [finite state transducer][fst]. This representation is built into���8JG [ucd-generate] but I am not aware of any advantage over the `ucd-trie`���9MJ representation. In particular `ucd-trie` is optimized for storing Unicode���9" properties while `fst` is not.��:���:,) [fst]: https://github.com/BurntSushi/fst���:>; [ucd-generate]: https://github.com/BurntSushi/ucd-generate��:���:MJ As far as I can tell, the main thing that causes `fst` to have large size���;MJ and slow lookups for this use case relative to `ucd-trie` is that it does���<KH not specialize for the fact that only 21 of the 32 bits in a `char` are���<NK meaningful. There are some dense arrays in the structure with large ranges���=&# that could never possibly be used.��=���=
 #### roaring��=���=HE This crate is a pure-Rust implementation of [Roaring Bitmap], a data���>DA structure designed for storing sets of 32-bit unsigned integers.��>���?63 [Roaring Bitmap]: https://roaringbitmap.org/about/��?���?PM Roaring bitmaps are compressed bitmaps which tend to outperform conventional���@PM compressed bitmaps such as WAH, EWAH or Concise. In some instances, they can���@IF be hundreds of times faster and they often offer significantly better���A
 compression.��A���AIF In this use case the performance was reasonably competitive but still���BIF substantially slower than the Unicode-optimized crates. Meanwhile the���BOL compression was significantly worse, requiring 6&times; as much storage for���C the data structure.��C���CPM I also benchmarked the [`croaring`] crate which is an FFI wrapper around the���DMJ C reference implementation of Roaring Bitmap. This crate was consistently���DPM about 15% slower than pure-Rust `roaring`, which could just be FFI overhead.���E" I did not investigate further.��E���E30 [`croaring`]: https://crates.io/crates/croaring��F���F #### unicode-ident��F���FOL This crate is most similar to the `ucd-trie` library, in that it's based on���FOL bitmaps stored in the leafs of a trie representation, achieving both prefix���G'$ compression and suffix compression.��G���G The key differences are:��H���HPM - Uses a single 2-level trie, rather than 3 disjoint partitions of different���H   depth each.���HEB - Uses significantly larger chunks: 512 bits rather than 64 bits.���IEB - Compresses the XID\_Start and XID\_Continue properties together���JOL   simultaneously, rather than duplicating identical trie leaf chunks across�t�J   the two.��J���JOL The following diagram show the XID\_Start and XID\_Continue Unicode boolean���K85 properties in uncompressed form, in row-major order:��K�\�K <table>���K41 <tr><th>XID_Start</th><th>XID_Continue</th></tr>�D�L <tr>���L�� <td><img alt="XID_Start bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647353-c6eeb922-afec-49b2-9ef5-c03e9d1e0760.png"></td>���M�� <td><img alt="XID_Continue bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647367-f447cca7-2362-4d7d-8cd7-d21c011d329b.png"></td>�L�O </tr>�d�O	 </table>��O���OPM Uncompressed, these would take 140 K to store, which is beyond what would be���OMJ reasonable. However, as you can see there is a large degree of similarity���PDA between the two bitmaps and across the rows, which lends well to���Q�Y�Q���QNK This crate stores one 512-bit "row" of the above bitmaps in the leaf level���QNK of a trie, and a single additional level to index into the leafs. It turns���RPM out there are 124 unique 512-bit chunks across the two bitmaps so 7 bits are��S sufficient to index them.��S���SOL The chunk size of 512 bits is selected as the size that minimizes the total���SLI size of the data structure. A smaller chunk, like 256 or 128 bits, would���TKH achieve better deduplication but require a larger index. A larger chunk���UIF would increase redundancy in the leaf bitmaps. 512 bit chunks are the���U:7 optimum for total size of the index plus leaf bitmaps.��V���VMJ In fact since there are only 124 unique chunks, we can use an 8-bit index���VGD with a spare bit to index at the half-chunk level. This achieves an���WNK additional 8.5% compression by eliminating redundancies between the second���WNK half of any chunk and the first half of any other chunk. Note that this is���XMJ not the same as using chunks which are half the size, because it does not���Y;8 necessitate raising the size of the trie's first level.��Y���YOL In contrast to binary search or the `ucd-trie` crate, performing lookups in���ZIF this data structure is straight-line code with no need for branching.���[�[�[8�l�[�[7$https://docs.rs/unicode-ident/1.0.24���[&��[?
��"�2�D�V�h�}	��
��\"��\T22DDVVhh}}��|�]$�]����^%��]>; Whether the character has the Unicode property XID\_Start.�d�^
ch��^��a(��aA> Whether the character has the Unicode property XID\_Continue.�|�a

�z�aT�\�<�\�$�\l�\��\4�\�4�����
��
|o�\>��
�
�R�
�

�
^`d��
H<���|���LGs�@|�
�HI�
�
�
^`d��
��'|����"\����%t���,����/T���|o�\>�����	
!%+/26:>�CGK������������P�������������������������������������������ORVZ���������������������0�^bdhlp�tvz~���������A����������)���˲���������������&��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������3l���|o�\>����#(-/48<@�EIM������������P�������������������������������������������OTX\���������������������0�`bfjnr�tx|����������A����������)���´���������������&����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������q+$�q���LGs�@|����=������������������������������ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������P߸@�����������������������������������������P��������������߸����������������������������������������������������������������������������������������������������������������������������������������������/`�����������������?����0������������������������������������������������������?$��?��������������������#���������#@������?���������������������������������������������y����P������m^������#�������#���=��������mӇ9^��?�������;����������9�����=�����=����������#7�������#p�������'@p��������/���������=`7�����������=`p�����������}�����������/�_��������������� _����������������������?_�������������������@������?<b���@����� ������������������������������������������'�������������������������������������?����� ������������������������������������������������������������������������������==�����=����==��������=��������������������??���������==�����=����==��������=����������������������??��������������������������������������������������������������������������������������������������������������������������������������������������������������������������?�������
�����������0�������������������������?������?����������������������������������?����������?�����������������������������������?����������������������?�����������������������������������?��������o��������������������������������������?�������������������������������������������������������������������/?P����C�����0��������/?P����C���������������������������������x����� �������������������������������������������� �����������������>�������������������������������������������������>��������������������������������������������������������������������?��������������������������������������������������������������������?����������������������������������������������������������������������������������������������������������h���?��������������|�������������������?����������?�����������������������������������b>8�~~~����������������������������?������������8��|~~~����������������������7��������������?�����������������_���������������������������������?�����������������_�������������������������������?���������������������������?����������������������������������������������?����������������������������������������������������������?�?�����������������������������?�?��������������������� ���������������������?���?�����>�������������������������?�����>�������������������?�����������������������������������������������������?�����������������������������������?���������?�������7��?������������������?����������������?��?����o�����?�����������������?��?��������������������������������?���?�������������������������������?���?������������?�����������������������?�����������&������������������G����������������?�������������������������O��������������������������������#��K�����
����������������������������9����K�������������������������������������������������������?�?������������������������������������������������������o����������
������������������o������������������������� ������������������������������#�����������������������������@�������������������������������������������������������������������������������������������������������������~������������������������������������������������������??����??�����?�������_������������?��������������������������������������������������������������o����������������������?������������������������������������?��������������������������������������|������������������������������������������������������������?�������������������������������������������������������������������������<����������������c�����?����������������������������d������������������{_�������������������������������������������?������������������������������������������������������?����������������������������������������������������� ���������������?������?@�����������?�������?�C���?�������������������������?������?��������������?�o������?�o��������������������������������������������������������������������������
�ꖪ���^���������������������������������������������������������������������������������?���������������������������������������������������������������������������������?�����������������������������������������������������?������������������������������������������������������������������������?������������������������=,�K\https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github�,https://github.com/rust-lang/rust/pull/33098�finite state transducer�!https://github.com/BurntSushi/fst�unicode-xid�)https://github.com/unicode-rs/unicode-xid�ucd-generate�!https://crates.io/crates/croaring�]https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust�(https://github.com/dtolnay/unicode-ident�	crates-io�&https://crates.io/crates/unicode-ident�^https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs�rust-lang/rust#33098�����%https://www.unicode.org/reports/tr31/�����croaring���github�������+https://github.com/RoaringBitmap/roaring-rs�����Unicode Standard Annex #31����� https://roaringbitmap.org/about/���������roaring�����https://docs.rs/unicode-ident�����Roaring Bitmap�������*https://github.com/BurntSushi/ucd-generate�������docs-rs��������������������������������������������������ư7�v���a��i?F�f���y��7�����o!���d��
8RHPn,�f���k+���D�f🸲���+\�[L�K(~1_
c��
vH�v(�,ZE�I
W)���Xȸ�\Q� ��Ō݀4�X�O�w��f���{#����`���V-ϒ���I�;I�����/Ü�q�J�`����BW�\�{J��]�)̒eŨp*_"q�F?�DT7�
�R����^P�t���$]�9��tp�(�r���-~����;��d<�<=�=�=W>l>�>?'?<?P?e?�AJ�;�=>�>%%



�;y<�<n=�=�=%>Y>r>�>�>?+?@?T?z?�A0J�'<-<0<7<<<B<H<N<T<Z<`<�<
=�=�=>F>S>i>�>�>�>?"?7?L?`?�A�AJJ�h*<4<?<E<K<Q<W<]<d<�<Y=�=�=>H>W>n>�>�>�>?'?<?P?e?�AJ�<�<|=�=9>P>c>�>�>�>??3?H?\?�?�A�AJ8Ji{<�<v=�=1>J>[>u>�>�>??-?B?V?|?�A�AJ2Ji�<�<~=�=?>g>�>�>? ?5?J?^?�?�A�AJ:J
i�<o=�='>t>�>�<o=>(>�>�>h<�<]=>�>i?�AJR>�>~F���.�,��*��E
-�+��)}=>�>&�z�s*�~�#w=�=�<�?BwJ�;�=�=l>�=�>�=�>����������������$(/6L^s������=�>
i�AJi
�o���o���P��f��f�"%��ư7�v�٫X��W��
rustfmt::skip��8[�ư7�v��M%��뙱vvv(vMvv=vov�ODHT !@���Ō݀4�X��o!���dBW�\�?F�f���yn,�f��"q�F?�tp�(�r�a��iDT7�
�R��[L�K(~
�k+��J�`�������^P�t���
8RHP�V-ϒ�������`��1_
c��
��/Ü�q��ư7�v��)���X��D�f�����+\	̒eŨp*_{J��]�)��$]�9��I�;I���ZE�I
W
vH�v(�,��7����O�w���f���{#���-~��� ��\Q� �,2�p<`d94�Y?��@i�(k�w�����|��ld�����\./�����KA���+�xt����BB,2�p<`d94�Y?��@d/home/palash/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-ident-1.0.24/src/tables.rs� 	1[��?-�_�f���Q@3+,6HK$;dddddddddddddddddddddddddF?dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
8ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddқ��O�*��{6�>[sa/home/palash/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-ident-1.0.24/src/lib.rs� J��^��B�L��M��t�d��kon	OA2OMQ	!K%JD>Q>KHN?A=BMKHBGO;	%PC#7&&$	MMMJLNMM;OGO2N#OPMNQLOQ4LAI**&*%&QLONPJQ3OPGON,PQ'QMQONP
MKN#-?NNLO'IE7QQJJJPQNQ#4PP(QFFPP95	��

QNEOOQPMLJ;NHOON<PJ@
 (Z?(5MGQB+8&GQ���N�o���!]�7���wz5}x86_64-unknown-linux-gnu��),�W�u�N���a�
unicode_ident�-61533c72d8f4e5f7��ư7�v����R��!� `-!< !@! B@!!B!BB? *@,!*B*!B*!!BB* @((!(B(!B��rust-end-file