token-string#
Short immutable strings to e.g. parse tokens, implemented in Rust. These are sometimes called "German Strings", because Germans have written the paper mentioning them, see The Paper for details.
- Memory Layout of a TokenString
- Usage of the Library
- Building and Testing the Source
- The Paper
- License
Memory Layout of a TokenString#
packet-beta title Small TokenString 0-1: "String length" 2-7: "Prefix" 8-15: "Short string data"
packet-beta title TokenString 0-1: "String length" 2-7: "Prefix" 8-15: "Pointer to data array"
Usage of the Library#
Building and Testing the Source#
The Paper#
Neumann, Freitag: Umbra: A Disk-Based System with In-Memory Performance mentions comparable small strings in chapter 3.1 String Handling at page 5.
The main difference to the variant I've implemented is that I use only 2 bytes
(16 bits) for the string length instead of 4 bytes (32 bits) in the paper. So the
maximum string length of TokenStrings is 65KB bytes compared to 4GB in the paper.
But we gain 2 bytes of length for the short strings contained in the struct
itself, 14 bytes vs. 12 bytes in the paper's version.
License#
The source in this repository is licensed under the Mozilla Public License version 2.0, see file ./LICENSE.