asm
gperf
Our great sponsors
asm | gperf | |
---|---|---|
4 | 7 | |
845 | 2 | |
0.9% | - | |
0.0 | 4.7 | |
6 months ago | about 2 months ago | |
Go | C++ | |
MIT No Attribution | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
asm
-
Quickly checking that a string belongs to a small set
We took a similar approach in our JSON decoder. We needed to support sets (JSON object keys) that aren't necessarily known until runtime, and strings that are up to 16 bytes in length.
We got better performance with a linear scan and SIMD matching than with a hash table or a perfect hashing scheme.
See https://github.com/segmentio/asm/pull/57 (AMD64) and https://github.com/segmentio/asm/pull/65 (ARM64). Here's how it's used in the JSON decoder: https://github.com/segmentio/encoding/pull/101
-
Changing one character wildly improved our application's performance
OP here, the algorithms we use give us about 5-10x the performance of the standard library sort, even compared against the new pdqsort in Go 1.19. https://github.com/segmentio/asm/pull/77
- Go library providing algorithms optimized for modern CPUs
- Segmentio/asm – Go library of algorithms optimized to leverage modern CPUs
gperf
-
What is an example of non-linear static data structure and what is an accurate breakdown of ds types?
Can create a ton of theoretical examples, but even in practice we use such data structures. An example that first came to mind is gperf which generates static hash table data structure for predefined set of strings (So you cannot add or remove any elements).
-
Hashtables
gperf is a generator for perfect hash functions. Its documentation has a bibliography that might contain helpful links.
- Quickly checking that a string belongs to a small set
-
Generating the code for an efficient conditional tree to select from a list of strings
I think gperf is what you need. Alternatively cmph.
-
How to emulate map literals in C?
Adding to this, there are tools such as gperf which are specifically designed for this. Apparently gperf works well for smaller number of keys but not for really high n (> 100,000 ish) and mph apparently works better for larger n.
- On implementing Bloom Filters in C
What are some alternatives?
sha256-simd - Accelerate SHA256 computations in pure Go using AVX512, SHA Extensions for x86 and ARM64 for ARM. On AVX512 it provides an up to 8x improvement (over 3 GB/s per core). SHA Extensions give a performance boost of close to 4x over native.
parallel-hashmap - A family of header-only, very fast and memory-friendly hashmap and btree containers.
faasd - A lightweight & portable faas engine
meow_hash - Official version of the Meow hash, an extremely fast level 1 hash
photoscope - Journey into photo management with golang
encoding - Go package containing implementations of efficient encoding, decoding, and validation APIs.
avo - Generate x86 Assembly with Go
robin-hood-hashing - Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
sourcery - 🧙 A simple but very fast recursive source code spell checker made in C
mph - (Fork) Minimal Perfect Hash
C-dictionary - The lightweight macro libary providing control flow as Python dictionary