Debian Codegraph @

/

debian rust-kstring 2.0.0-1debian librust-kstring-dev debian librust-kstring+arc-dev debian librust-kstring+default-dev debian librust-kstring+max-inline-dev debian librust-kstring+serde-dev debian librust-kstring+std-dev debian librust-kstring+unsafe-dev debian librust-kstring+unstable-bench-subset-dev debian librust-kstring-2-dev debian librust-kstring-2+arc-dev debian librust-kstring-2+default-dev debian librust-kstring-2+max-inline-dev debian librust-kstring-2+serde-dev debian librust-kstring-2+std-dev debian librust-kstring-2+unsafe-dev debian librust-kstring-2+unstable-bench-subset-dev debian librust-kstring-2.0-dev debian librust-kstring-2.0+arc-dev debian librust-kstring-2.0+default-dev
14 more… debian librust-kstring-2.0+max-inline-dev debian librust-kstring-2.0+serde-dev debian librust-kstring-2.0+std-dev debian librust-kstring-2.0+unsafe-dev debian librust-kstring-2.0+unstable-bench-subset-dev debian librust-kstring-2.0.0-dev debian librust-kstring-2.0.0+arc-dev debian librust-kstring-2.0.0+default-dev debian librust-kstring-2.0.0+max-inline-dev debian librust-kstring-2.0.0+serde-dev debian librust-kstring-2.0.0+std-dev debian librust-kstring-2.0.0+unsafe-dev debian librust-kstring-2.0.0+unstable-bench-subset-dev cargo kstring 2.0.0
debianjsonmakefilemarkdownrustrustrust-c-abishelltoml 24 files · 535 symbols
View dependency graph

Depends on

  • debhelper (debhelper)
  • dh-cargo (dh-cargo)
  • cargo, librust-serde-1+default-dev, librust-static-assertions-1+default-dev, libstd-rust-dev, rustc
README (full)

KString

Key String: Optimized for map keys.

Crates Status

Background

Considerations:

  • Large maps
  • Most keys live and drop without being used in any other way
  • Most keys are relatively small (single to double digit bytes)
  • Keys are immutable
  • Allow zero-cost abstractions between structs and maps (e.g. no allocating when dealing with struct field names)

Ramifications:

  • Inline small strings rather than going to the heap.
  • Preserve &'static str across strings (KString), references (KStringRef), and lifetime abstractions (KStringCow) to avoid allocating for struct field names.
  • Use Box<str> rather than String to use less memory.

Features

  • max_inline: Instead of aligning the inline-string for performance (15 bytes + length on 64-bit), use the full width (22 bytes on 64-bit)
  • arc: Instead of using Box<str>, use Arc<str>. Note: allocations are fast enough that this can actually slow things down for small enough strings.

Alternatives

  • smol_str
    • Size of String
    • Always uses Arc instead of Box
    • Always inlines 22 bytes
    • Whitespace-only optimizations
  • smartstring
    • Size of String
    • Allows mutability at the cost of relying on implementation details of String
    • Always inlines 23 bytes
  • compact_str
    • Size of String
    • Always uses Arc instead of Box
    • Inlines 22-23 bytes, depending on implementation

License

Licensed under either of

  • Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

dir benches/
dir debian/
dir examples/
dir src/
file .cargo_vcs_info.json
file Cargo.lock
file Cargo.toml
file Cargo.toml.orig
file LICENSE-APACHE
file LICENSE-MIT
file README.md