Clemcl
8 hours ago
I’ve been working on a C string library called FastSafeStrings.
The goal is to keep the performance of traditional C string handling while making it safer and avoiding repeated scans (strlen, strcat, delimiter searches).
Key ideas:
* Length-aware strings (O(1) length, no rescanning) * Bounds-safe operations (no buffer overruns) * Fixed-capacity model (no allocations) * Optional support for variable-length (VB-style) records to eliminate input scanning
In a simple real-world workload (processing 5M small records), it runs about ~7× faster than typical C code using fgets/strcat/strlen.
This is an early release — I’d really appreciate feedback on:
* API design (especially the macro-based C interface) * Benchmark fairness and methodology * Edge cases or safety concerns