lights FAQ Forum github.com/luapower/terra.phf
This package
terra.phf

Terra Standard Libraries
terra.low
terra.arrayview
terra.dynarray
terra.hashmap
terra.phf
terra.linkedlist
terra.fixedfreelist
terra.arrayfreelist
terra.lrucache
terra.bitarray
terra.utf8
terra.random

terra.phf

Minimal Perfect Hash Function Generator for Lua/Terra


--[[

	Minimal Perfect Hash Function Generator for Lua/Terra.
	Written by Cosmin Apreutesei. Public Domain.

	Generation at compile-time in Lua, lookup at runtime in Terra.
	Supports Lua string keys and any-fixed-size-type keys and values.
	It's particularly fast with (u)int32 keys.
	Algorithm from http://stevehanov.ca/blog/index.php?id=119.

	TODO: generate C switch code see if LLVM converts it to phf and check speed.
	TODO: generate Terra if/else code and see if LLVM can see it as a switch.
	TODO: test/compare all with binsearch and linear-search-with-a-sentinel.

]]

See the source code for more info.


Package:terra.phf
Pkg type:Terra
Version: b0434aa
Last commit:
Author: Cosmin Apreutesei
License: Public Domain
Requires: +terra.low  +glue  +luajit  +pp 
Required by: none

Top