lemire

Fast, immutable, compact map from strings to 64-bit integers β€” for Python.

21
0
89% credibility
Found May 17, 2026 at 24 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
C
AI Summary

FastConstMap is a Python library that creates super-fast, memory-efficient lookup tables mapping text strings to numbers. Built in the C programming language for speed, it can find values in a fraction of the time and uses about 13 times less memory than regular Python dictionaries. It offers two modes: a minimal version for maximum speed, and a verified version that safely detects when someone asks for a key that doesn't exist. The lookup tables can be saved to files or shared across multiple programs running at the same time without copying the data. This is useful for applications that need to look up millions of items quickly, like matching product codes, checking identifiers, or finding records by name.

How It Works

1
πŸ’‘ You discover you need fast lookups

Your application needs to look up millions of text labels and get back numbers, and regular dictionaries are too slow or use too much memory.

2
πŸ“¦ You install the library

With one simple command, the library installs on your computer and is ready to use in your Python projects.

3
πŸ—ΊοΈ You create your lookup table

You give the library a list of text-to-number pairs, and it builds a lightning-fast lookup structure behind the scenes.

4
⚑ Your lookups are blazingly fast

Finding a value takes only a tiny fraction of a second, even with millions of entries, and your computer uses far less memory than before.

5
You choose your lookup style
🎯
Basic mode

Ultra-fast and tiny, perfect when you know all your lookups will be valid.

πŸ›‘οΈ
Verified mode

Slightly larger but catches mistakes, behaving like a normal dictionary with error checking.

6
πŸ”— You share data between programs

Your lookup table can be saved to a file or shared across multiple running programs without copying, so everyone sees the same data instantly.

πŸŽ‰ Everything works perfectly

Your application runs faster, uses less memory, and your lookups happen so quickly your users barely notice the wait.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 24 to 21 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is fastconstmap?

fastconstmap is a Python library that stores string-to-integer mappings in a blazing-fast C data structure. You build it once from a dictionary, then look up values at around twice the speed of a regular Python dict while using roughly 13 times less memory. It comes in two flavors: a minimal version that devours 9 bytes per key but silently returns garbage for unknown keys, and a verified version that doubles the memory cost but raises proper KeyErrors when you miss.

Why is it gaining traction?

The killer feature is the batch lookup API. If you need to look up thousands of keys at once, a single call to get_many() crushes a Python list comprehension by roughly 2x. The serialization story is also clean: maps save to files or raw bytes, and you can plop one into multiprocessing shared memory for zero-copy access across processes. For workloads that repeatedly query the same fixed set of keys -- think routing tables, feature flags, or enum lookups -- this solves the memory bloat and speed penalty of keeping a dict in memory.

Who should use this?

Backend engineers building high-throughput services that query static lookup tables will benefit most. If you are currently passing around a dict with thousands of string keys and wondering why your memory bill is high, this replaces it with something leaner and faster. Data engineers doing repeated filter or join operations on fixed key sets should also look here. It is less useful for workloads with frequent updates or small key counts where a dict is fast enough.

Verdict

This is a specialized tool for a specific problem: fast, memory-efficient, immutable lookups from strings to integers. The implementation is solid (Daniel Lemire's name carries weight in this space) and the benchmarks are reproducible. At 21 stars the community is tiny, and that credibility score of less than 1% reflects a young project with limited adoption. If your workload matches the use case, the risk is low and the payoff is real. Otherwise, keep it in your back pocket for when you need it.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.