jsmn: A Powerful C Library for JSON Parsing

jsmn is a minimalistic and high-performance JSON parser written in C, particularly suitable for use in resource-constrained embedded environments. Its design goal is to maintain a very small code size and memory footprint while not relying on any external libraries. The table below summarizes the main features of jsmn for quick reference: Feature Category Details … Read more

simdjson: A Powerful C++ Library

⚡ simdjson: An Ultra-Fast C++ Library for Parsing GB-Level JSON per Second Have you encountered these issues in web services, big data processing, log analysis, database systems, or real-time communication? “JSON parsing is too slow, becoming a bottleneck in the system!”“Is there a faster solution than RapidJSON or nlohmann/json?”“Can we parse several GB of JSON … Read more

21.6k Stars! Parsing GBs of JSON Data Per Second, SIMD Instructions Boost Performance by 25 Times!

21.6k Stars! Parsing GBs of JSON Data Per Second, SIMD Instructions Boost Performance by 25 Times!

Yesterday afternoon, my boss approached me with a stern expression: “Why is this data processing so slow? The clients are complaining.” I glanced at the screen and noticed that the progress bar was almost stuck in place, leaving me speechless. I believe most people have had similar experiences; even when the code logic is flawless, … Read more

C++ Learning Manual – File I/O and Serialization: JSON/XML Parsing (Third-party Libraries: RapidJSON, pugixml)

C++ Learning Manual - File I/O and Serialization: JSON/XML Parsing (Third-party Libraries: RapidJSON, pugixml)

In modern C++ application development, exchanging data with external systems or persisting complex data structures is commonplace. JSON and XML, as two of the most popular data exchange formats, play a crucial role. Although the C++ standard library provides basic file I/O functionality, it does not include native support for JSON or XML. Therefore, leveraging … Read more

Essential for Embedded Development! A Detailed Overview of the Lightweight JSON Library tiny-json, Your Savior in Memory-Constrained Scenarios

Essential for Embedded Development! A Detailed Overview of the Lightweight JSON Library tiny-json, Your Savior in Memory-Constrained Scenarios

In embedded development, do you often encounter the dilemma: the device has limited memory, and you want to use JSON, a universal data format, but are deterred by the “bulkiness” of mainstream libraries? Don’t worry, today I will introduce a lightweight JSON parsing/generating library specifically designed for resource-constrained scenarios—tiny-json, allowing you to easily handle JSON … Read more

Practical Python Pattern Matching: Refactoring JSON Parsers with match/case Reduces Code by 40%!

Practical Python Pattern Matching: Refactoring JSON Parsers with match/case Reduces Code by 40%!

Practical Python Pattern Matching: Refactoring JSON Parsers with match/case Reduces Code by 40%! 1. Introduction Have you ever been tormented by layers of nested <span>if/elif</span> code blocks? Let’s take a look at a piece of code that parses user data and feel the “code hell”: def parse_user(data): if isinstance(data, dict): if "name" in data: name … Read more

A Guide to Avoiding Pitfalls with Content-Length in HTTP Requests

A Guide to Avoiding Pitfalls with Content-Length in HTTP Requests

Scenario Recreation: A Frustrating JSON Parsing Issue Recently, during a project integration process, our team encountered a bizarre JSON parsing issue. Here’s what happened: The frontend team copied a normal cURL request from Chrome Developer Tools: curl -X POST https://api.ourcompany.com/v1/orders \ -H "Content-Type: application/json" \ -H "Content-Length: 187" \ -d '{"order_id":"123456","products":[{"sku":"A001","qty":2}],"remark":"Weekend Delivery"}' This request worked … Read more