- Notifications
You must be signed in to change notification settings - Fork0
Compress hash displace algorithm for faster Julia dictionaries
License
NotificationsYou must be signed in to change notification settings
Arkoniak/CompressHashDisplace.jl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Documentation | Build Status |
---|---|
This package creates read-only dictionaries with fast access speed.
julia> ] add CompressHashDisplace
using BenchmarkToolsusing CompressHashDisplaceDICTIONARY="/usr/share/dict/words"dict=Dict{String, Int}()for (line, word)inenumerate(readlines(DICTIONARY)) dict[word]= lineendfrozen_dict=FrozenDict(dict)frozen_dict["hello"]# 50196frozen_unsafe_dict=FrozenUnsafeDict(dict)frozen_unsafe_dict["hello"]# 50196word="hello"@btime$dict[$word]# 76.615 ns (0 allocations: 0 bytes)@btime$frozen_dict[$word]# 60.028 ns (0 allocations: 0 bytes)@btime$frozen_unsafe_dict[$word]# 22.124 ns (0 allocations: 0 bytes)
Main difference betweenFrozenDict
andFrozenUnsafeDict
is thatFrozenUnsafeDict
do not validate input key
frozen_dict["foo"]# KeyError: key "foo" not foundfrozen_unsafe_dice["foo"]# 59716, i.e. some random value
About
Compress hash displace algorithm for faster Julia dictionaries
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Contributors3
Uh oh!
There was an error while loading.Please reload this page.