symbolize: Efficient global Symbol table, with Garbage Collection.
Symbols, also known as Atoms or Interned Strings, are a common technique to reduce memory usage and improve performance when using many small strings.
By storing a single copy of each encountered string in a global table and giving out pointers to the stored keys,
it is possible to compare strings for equality in constant time, instead of linear (in string size) time.
Furthermore, by using StableName, hashing of Symbols also takes constant-time, so Symbols make great hashmap keys!.
The main advantages of Symbolize over other symbol table implementations are:
Garbage collection: Symbols which are no longer used are automatically cleaned up.
Support for any
Textualtype, includingString, (strict and lazy)Data.Text, (strict and lazy)Data.ByteString,ShortText,ShortByteString, etc.Great memory usage:
Symbols are simply a (lifted) wrapper around aByteArray#, which is nicely unpacked by GHC.The symbol table is an
IntMapthat contains weak pointers to these sameByteArray#s and their associatedStableName#sGreat performance:
uninternis a simple pointer-dereferencecalls to
lookupare free of atomic memory barriers (and never have to wait on a concurrent thread runningintern)Thread-safe
Please see the full README below or on GitHub at https://github.com/Qqwy/haskell-symbolize#readme
[Skip to Readme]
Downloads
- symbolize-1.0.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 1.0.0.0, 1.0.0.1, 1.0.0.2, 1.0.0.3, 1.0.0.4, 1.0.1.0, 1.0.2.0, 1.0.2.1, 1.0.2.2, 1.0.2.3, 1.0.2.4, 1.0.3.0, 1.0.3.1 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4.7 && <5), bytestring (>=0.11.0 && <0.13), containers (>=0.6.0 && <0.7), deepseq (>=1.4.0 && <1.6), hashable (>=1.4.0 && <1.5), random (>=1.2 && <2), text (>=2.0 && <2.2), text-short (>=0.1.0 && <0.2) [details] |
| License | BSD-3-Clause |
| Copyright | 2023-2025 Marten Wijnja |
| Author | Qqwy / Marten |
| Maintainer | [email protected] |
| Uploaded | by qqwy at 2025-02-17T18:49:59Z |
| Category | Data, Data Structures |
| Home page | https://github.com/Qqwy/haskell-symbolize#readme |
| Bug tracker | https://github.com/Qqwy/haskell-symbolize/issues |
| Source repo | head: git clone https://github.com/Qqwy/haskell-symbolize |
| Distributions | LTSHaskell:1.0.3.1, NixOS:1.0.3.1, Stackage:1.0.3.1 |
| Downloads | 651 total (43 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2025-02-17 [all 1 reports] |