The Hidden Cost of Software Libraries
date: 2025-10-26Tags: #til, #clang, #rustTurns out the Rust version with clap is 50x SLOWER! 54.41 to be exact. 1
Rust usually runs close to C speeds for equivalent implementations, so the speed difference is likely all overhead from the library.
50x hit to performance. Just so you can have some magic macros for your command line interface.
TIL, clap will slow down the startup times. But it's just call only "once" while parsing aruments.
Sort of balance between usablitiy and extre performace?
Footnotes
JSON isn't JSON
date: 2025-10-08Tags: #dev, #good-readingJSON (JavaScript Object Notation) was supposed to be the universal data interchange format that would solve the compatibility nightmares of XML. What looks like astraightforward data format becomes a minefield of subtle incompatibilities, edge cases, and implementation quirks that can break your applications in unexpected ways.1
Common pitfalls (selected by myself from the article):
- The Number Nightmare
- not only precision loss for large integers
- but also
NaNandInf, see also Daniel Lemire's tweet 2
- String Encoding Chaos
- The character
écan be represented as:- A single codepoint:
U+00E9(é) - Composed form:
U+0065 U+0301(e+́)
- A single codepoint:
- The character
- Object Key Ordering
- It's fun that this may influence LLM KV cache performance now
- Null vs. Undefined vs. Missing
- Date and Time Fun
Authors' Recommendations:
- Use Schema Validation: The First Law of JSON Robotics
- Normalize Data Types
- Library Selection Matters
- Test Cross-Language Compatibility
May the Parse Be With You