https://github.com/juancarlospaco/dik
Table implemented as optimized sorted hashed dictionary for heterogeneous values
https://github.com/juancarlospaco/dik
dictionary hashmap nim nim-lang
Last synced: about 1 month ago
JSON representation
Table implemented as optimized sorted hashed dictionary for heterogeneous values
- Host: GitHub
- URL: https://github.com/juancarlospaco/dik
- Owner: juancarlospaco
- License: mit
- Created: 2021-05-06T15:41:40.000Z (almost 4 years ago)
- Default Branch: nim
- Last Pushed: 2022-01-26T21:13:12.000Z (over 3 years ago)
- Last Synced: 2025-01-26T14:48:41.480Z (3 months ago)
- Topics: dictionary, hashmap, nim, nim-lang
- Language: Nim
- Homepage: https://juancarlospaco.github.io/dik
- Size: 63.5 KB
- Stars: 21
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Dik
Table implemented as optimized sorted hashed dictionary,
same size and API as a Table, 0 dependencies, ~300 lines.Get items by index or `BackwardsIndex` or `Slice` or `string`,
destructor, resize in-place, `toSeq`, `pretty`, Heterogeneous values, tests for everything.Documentation, Tests, Examples: https://juancarlospaco.github.io/dik








# Benchmark
| Operation | `Table` | `Dik` |
|-----------|------------------|---------------------|
| `del()` | 974 microseconds | 301 microseconds |
| `clear()` | 5 milliseconds | 150 microseconds |
| `add()` | 418 microseconds | 250 microseconds |
| `get()` | 242 microseconds | 220 microseconds |`Table` is not ordered and does not return `Option[T]`, so it is just an approximation for development.
[source](https://github.com/juancarlospaco/dik/blob/nim/benchmark.nim)
# FAQ
- Whats the name ?.
[Dik](https://en.wikipedia.org/wiki/Dik-dik) is a Dict.
# Stars
