MyNixOS website logo
Description

Efficient vector-based mutable hashtables implementation.

This package provides efficient vector-based hashtable implementation similar to .NET Generic Dictionary implementation (at the time of 2015).

See Data.Vector.Hashtables for documentation.

vector-hashtables

Hackage Stackage Nightly Version Stackage LTS Version Build Status

A brief history of this library is given in this blog post.

Benchmarks vs hashtables

(and vector where relevant)

Benchmarks below are produced under GHC 9.4.8, and can be reproduced locally with

cabal bench --benchmark-options="--csv results.csv"
bench-show report results.csv

(You will need the bench-show tool, which is available from Hackage.)

Benchmarkv.0.1.1.4 (ns)current (ns)
Comparison/1000/insert/hashtables basic36083.5736907.68
Comparison/1000/insert/vector-hashtables boxed25735.1317055.86
Comparison/1000/insert/vector-hashtables unboxed keys23601.0815333.05
Comparison/1000/insert/vector-hashtables25298.6713881.72
Comparison/1000/insert/mutable vector boxed6458.143658.16
Comparison/1000/insert/mutable vector2526.351282.13
Comparison/1000/insert (resize)/hashtables basic318207.51159834.87
Comparison/1000/insert (resize)/vector-hashtables boxed106490.8425900.28
Comparison/1000/insert (resize)/vector-hashtables unboxed keys66848.4025382.56
Comparison/1000/insert (resize)/vector-hashtables65694.6621393.31
Comparison/1000/insert, delete/hashtables basic96776.4172615.51
Comparison/1000/insert, delete/vector-hashtables79701.4420920.26
Comparison/1000/find/hashtables basic22841.8523678.93
Comparison/1000/find/vector-hashtables16398.195586.93
Comparison/1000/find/vector-hashtables (frozen)11967.633128.18
Comparison/1000/lookupIndex/hashtables basic19744.2719209.79
Comparison/1000/lookupIndex/vector-hashtables13624.094978.75
Comparison/1000/fromList/hashtables basic167277.66162920.75
Comparison/1000/fromList/vector-hashtables48670.7525283.17
Comparison/1000/toList/hashtables basic9296.919286.65
Comparison/1000/toList/vector-hashtables9753.5810022.51
Comparison/10000/insert/hashtables basic384031.02373885.01
Comparison/10000/insert/vector-hashtables boxed246923.90175892.73
Comparison/10000/insert/vector-hashtables unboxed keys229812.05147689.46
Comparison/10000/insert/vector-hashtables216924.38128417.71
Comparison/10000/insert/mutable vector boxed43104.2042712.36
Comparison/10000/insert/mutable vector12298.8112193.85
Comparison/10000/insert (resize)/hashtables basic1342541.641378595.70
Comparison/10000/insert (resize)/vector-hashtables boxed487188.49273187.43
Comparison/10000/insert (resize)/vector-hashtables unboxed keys441635.60242659.06
Comparison/10000/insert (resize)/vector-hashtables412651.12188011.22
Comparison/10000/insert, delete/hashtables basic722883.16736250.66
Comparison/10000/insert, delete/vector-hashtables407113.19200643.92
Comparison/10000/find/hashtables basic228154.09232874.24
Comparison/10000/find/vector-hashtables164343.0655693.39
Comparison/10000/find/vector-hashtables (frozen)119669.0031291.02
Comparison/10000/lookupIndex/hashtables basic197212.48191707.57
Comparison/10000/lookupIndex/vector-hashtables136205.7049762.50
Comparison/10000/fromList/hashtables basic1391968.881562065.86
Comparison/10000/fromList/vector-hashtables430590.93233128.12
Comparison/10000/toList/hashtables basic112894.13114543.83
Comparison/10000/toList/vector-hashtables152214.13154034.89
Comparison/100000/insert/hashtables basic4492224.864546924.57
Comparison/100000/insert/vector-hashtables boxed2414664.981767261.44
Comparison/100000/insert/vector-hashtables unboxed keys2243027.451476174.02
Comparison/100000/insert/vector-hashtables2144269.701272101.52
Comparison/100000/insert/mutable vector boxed667945.33666673.13
Comparison/100000/insert/mutable vector121264.87123138.53
Comparison/100000/insert (resize)/hashtables basic18217163.1618777839.68
Comparison/100000/insert (resize)/vector-hashtables boxed9452674.697287443.14
Comparison/100000/insert (resize)/vector-hashtables unboxed keys7721635.335698107.38
Comparison/100000/insert (resize)/vector-hashtables4722092.982574932.04
Comparison/100000/insert, delete/hashtables basic8699786.668790937.73
Comparison/100000/insert, delete/vector-hashtables4073127.472010559.30
Comparison/100000/find/hashtables basic2283995.012346364.66
Comparison/100000/find/vector-hashtables1676135.49588427.30
Comparison/100000/find/vector-hashtables (frozen)1201572.29319639.97
Comparison/100000/lookupIndex/hashtables basic1963727.731931036.13
Comparison/100000/lookupIndex/vector-hashtables1363501.76499992.98
Comparison/100000/fromList/hashtables basic20681183.3130059346.94
Comparison/100000/fromList/vector-hashtables5262183.793945839.47
Comparison/100000/toList/hashtables basic2675794.962702739.12
Comparison/100000/toList/vector-hashtables5155629.155118781.70
Comparison/1000000/insert/hashtables basic86723317.7285752701.43
Comparison/1000000/insert/vector-hashtables boxed68162021.2375667649.90
Comparison/1000000/insert/vector-hashtables unboxed keys50777620.4446615543.58
Comparison/1000000/insert/vector-hashtables23334885.4316025927.63
Comparison/1000000/insert/mutable vector boxed30281652.6232068295.04
Comparison/1000000/insert/mutable vector1283399.431393859.51
Comparison/1000000/insert (resize)/hashtables basic228726522.46282346897.14
Comparison/1000000/insert (resize)/vector-hashtables boxed104556190.0184385042.40
Comparison/1000000/insert (resize)/vector-hashtables unboxed keys79183320.3062413398.66
Comparison/1000000/insert (resize)/vector-hashtables45925222.0828777902.04
Comparison/1000000/insert, delete/hashtables basic130189177.30134399640.44
Comparison/1000000/insert, delete/vector-hashtables42722592.0423648387.28
Comparison/1000000/find/hashtables basic23094297.7324583079.42
Comparison/1000000/find/vector-hashtables16709242.486178348.57
Comparison/1000000/find/vector-hashtables (frozen)12176361.823425505.60
Comparison/1000000/lookupIndex/hashtables basic20222788.0819753759.16
Comparison/1000000/lookupIndex/vector-hashtables14041315.595357116.98
Comparison/1000000/fromList/hashtables basic210947448.60222974094.62
Comparison/1000000/fromList/vector-hashtables56875691.6049212505.34
Comparison/1000000/toList/hashtables basic62256321.1566351583.99
Comparison/1000000/toList/vector-hashtables95883670.5798441804.39
Utilities benchmark:
Benchmarkv.0.1.1.4 (ns)current (ns)
Utilities/1000/at'14554.084755.41
Utilities/1000/insert16704.556842.45
Utilities/1000/delete11166.803959.44
Utilities/1000/lookup14510.595161.87
Utilities/1000/lookup'14181.874739.19
Utilities/1000/lookupIndex17171.764196.40
Utilities/1000/null7.197.92
Utilities/1000/length7.317.41
Utilities/1000/size6.856.53
Utilities/1000/member17364.484344.27
Utilities/1000/findWithDefault15747.104802.97
Utilities/1000/upsert32633.2512708.79
Utilities/1000/alter31908.5411109.48
Utilities/1000/alterM32564.1411110.53
Utilities/1000/union46432.1029468.82
Utilities/1000/difference25741.6816296.53
Utilities/1000/intersection58828.3838587.57
Utilities/1000/fromList45355.8526156.93
Utilities/1000/toList9626.8910101.05
Utilities/10000/at'147509.6648699.88
Utilities/10000/insert171201.5668568.34
Utilities/10000/delete111650.4239392.43
Utilities/10000/lookup149138.4749800.41
Utilities/10000/lookup'144283.3146886.69
Utilities/10000/lookupIndex172630.0940088.94
Utilities/10000/null7.207.24
Utilities/10000/length7.306.77
Utilities/10000/size6.876.43
Utilities/10000/member170650.6843369.07
Utilities/10000/findWithDefault157236.9249471.03
Utilities/10000/upsert329212.06125290.78
Utilities/10000/alter322814.62111817.84
Utilities/10000/alterM330094.30112444.63
Utilities/10000/union478541.46329790.79
Utilities/10000/difference295042.17193790.26
Utilities/10000/intersection644396.71419483.32
Utilities/10000/fromList494164.34331449.21
Utilities/10000/toList151375.79167580.99
Utilities/100000/at'1491045.70495418.68
Utilities/100000/insert1741058.94765507.51
Utilities/100000/delete1127146.84436707.82
Utilities/100000/lookup1601916.69562205.51
Utilities/100000/lookup'1441526.57488540.28
Utilities/100000/lookupIndex1763172.42405596.28
Utilities/100000/null7.197.26
Utilities/100000/length7.387.17
Utilities/100000/size6.926.83
Utilities/100000/member1740066.09464281.90
Utilities/100000/findWithDefault1577458.36489790.85
Utilities/100000/upsert3383104.751265454.18
Utilities/100000/alter3329820.091211692.27
Utilities/100000/alterM3356140.571220060.24
Utilities/100000/union5563999.763705665.39
Utilities/100000/difference6372930.195630405.29
Utilities/100000/intersection12353680.599595098.36
Utilities/100000/fromList5161712.373685646.90
Utilities/100000/toList5109243.495118785.28
Utilities/1000000/at'14831244.235055419.26
Utilities/1000000/insert17633535.067209602.12
Utilities/1000000/delete11251853.984072535.57
Utilities/1000000/lookup15169518.905208497.64
Utilities/1000000/lookup'14532451.214929673.79
Utilities/1000000/lookupIndex17529914.964216663.23
Utilities/1000000/null7.207.25
Utilities/1000000/length7.306.81
Utilities/1000000/size6.866.43
Utilities/1000000/member17461069.354604944.15
Utilities/1000000/findWithDefault15945541.785058608.89
Utilities/1000000/upsert34444162.7912052143.01
Utilities/1000000/alter33820504.8811842773.92
Utilities/1000000/alterM33991841.7111908234.12
Utilities/1000000/union59911378.7344470700.12
Utilities/1000000/difference117323371.53107670945.26
Utilities/1000000/intersection195009586.71161847790.47
Utilities/1000000/fromList97086662.7752734408.34
Utilities/1000000/toList166554860.9999619875.06
Metadata

Version

0.1.2.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows