Hyperbee.json
A high-performance JSON library for System.Text.Json JsonElement and JsonNode, providing robust support for JSONPath, JsonPointer, JsonPatch, and JsonDiff.
Install / Use
/learn @Stillpoint-Software/Hyperbee.jsonREADME
Welcome to Hyperbee Json
Hyperbee Json is a high-performance JSON library for .NET, providing robust support for JSONPath, JsonPointer, JsonPatch, and JsonDiff. This library is optimized for speed and low memory allocations, and it adheres to relevant RFCs to ensure reliable and predictable behavior.
Unlike other libraries that support only JsonElement or JsonNode, Hyperbee.Json supports both types, and can be easily extended to
support additional document types and functions.
Features
- High Performance: Optimized for performance and efficiency.
- Low Memory Allocations: Designed to minimize memory usage.
- Comprehensive JSON Support: Supports JSONPath, JsonPointer, JsonPatch, and JsonDiff.
- Conformance: Adheres to the JSONPath Specification RFC 9535, JSONPointer RFC 6901, and JsonPatch RFC 6902.
- Supports both
JsonElementandJsonNode: Works seamlessly with both JSON document types.
JSONPath
JSONPath is a query language for JSON, allowing you to navigate and extract data from JSON documents using a set of path expressions. Hyperbee.Json's JSONPath implementation is designed for optimal performance, ensuring low memory allocations and fast query execution. It fully conforms to RFC 9535.
JSONPointer
JSONPointer is a syntax for identifying a specific value within a JSON document. It is simple and easy to use, making it an excellent choice for pinpointing exact values. Hyperbee.Json's JsonPointer implementation adheres to RFC 6901.
JSONPatch
JSONPatch is a format for describing changes to a JSON document. It allows you to apply partial modifications to JSON data efficiently. Hyperbee.Json supports JsonPatch as defined in RFC 6902.
JSONDiff
JSONDiff allows you to compute the difference between two JSON documents, which is useful for versioning and synchronization. Hyperbee.Json's implementation is optimized for performance and low memory usage, adhering to the standards set in RFC 6902.
Getting Started
To get started with Hyperbee.Json, refer to the documentation for detailed instructions and examples.
You can intall the library via NuGet:
dotnet add package Hyperbee.Json
Benchmarks
Here is a performance comparison of various JSONPath queries on the standard book store document.
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{
"category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{
"category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
| Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
|------------------------ | ----------:|-----------:|----------:|-------:|-------:|----------:|
| $..[?(@.price < 10)]
| JsonCraft.JsonElement | 2.957 us | 1.1397 us | 0.0625 us | 0.2899 | - | 3.59 KB |
| Hyperbee.JsonElement | 5.221 us | 0.8505 us | 0.0466 us | 1.2894 | 0.0076 | 15.84 KB |
| JsonCons.JsonElement | 5.518 us | 1.3367 us | 0.0733 us | 1.0376 | 0.0076 | 12.73 KB |
| Hyperbee.JsonNode | 5.915 us | 0.8714 us | 0.0478 us | 1.4954 | 0.0153 | 18.38 KB |
| Newtonsoft.JObject | 8.009 us | 1.7612 us | 0.0965 us | 2.1057 | 0.0763 | 25.86 KB |
| JsonEverything.JsonNode | 17.850 us | 12.0238 us | 0.6591 us | 3.9063 | 0.1221 | 48.15 KB |
| | | | | | | |
| $..['bicycle','price']
| JsonCraft.JsonElement | 2.309 us | 0.2498 us | 0.0137 us | 0.3242 | - | 4.01 KB |
| Hyperbee.JsonElement | 2.701 us | 1.0824 us | 0.0593 us | 0.4158 | - | 5.12 KB |
| JsonCons.JsonElement | 3.058 us | 0.3820 us | 0.0209 us | 0.5760 | 0.0038 | 7.09 KB |
| Hyperbee.JsonNode | 3.626 us | 1.3209 us | 0.0724 us | 0.7210 | 0.0114 | 8.84 KB |
| Newtonsoft.JObject | 4.990 us | 1.5961 us | 0.0875 us | 1.1826 | 0.0458 | 14.55 KB |
| JsonEverything.JsonNode | 12.183 us | 2.7932 us | 0.1531 us | 2.3193 | 0.0610 | 28.5 KB |
| | | | | | | |
| $..*
| JsonCraft.JsonElement | 2.023 us | 0.4743 us | 0.0260 us | 0.2327 | - | 2.88 KB |
| Hyperbee.JsonElement | 2.390 us | 0.7132 us | 0.0391 us | 0.5226 | 0.0038 | 6.45 KB |
| JsonCons.JsonElement | 3.239 us | 0.8771 us | 0.0481 us | 0.6866 | 0.0038 | 8.45 KB |
| Hyperbee.JsonNode | 3.864 us | 2.6714 us | 0.1464 us | 0.7629 | - | 9.54 KB |
| Newtonsoft.JObject | 4.864 us | 0.7073 us | 0.0388 us | 1.1520 | 0.0458 | 14.19 KB |
| JsonEverything.JsonNode | 17.367 us | 10.7988 us | 0.5919 us | 2.7466 | 0.0610 | 33.97 KB |
| | | | | | | |
|$..author
| JsonCraft.JsonElement | 2.071 us | 0.8571 us | 0.0470 us | 0.2327 | - | 2.88 KB |
| Hyperbee.JsonElement | 2.275 us | 0.5597 us | 0.0307 us | 0.4158 | - | 5.1 KB |
| JsonCons.JsonElement | 2.572 us | 0.2856 us | 0.0157 us | 0.4463 | 0.0038 | 5.47 KB |
| Hyperbee.JsonNode | 3.226 us | 0.6372 us | 0.0349 us | 0.7019 | - | 8.64 KB |
| Newtonsoft.JObject | 4.793 us | 3.7445 us | 0.2053 us | 1.1520 | 0.0381 | 14.2 KB |
| JsonEverything.JsonNode | 11.786 us | 2.5761 us | 0.1412 us | 2.0752 | - | 26.1 KB |
| | | | | | | |
| $..book[?@.isbn]
| Hyperbee.JsonElement | 2.814 us | 0.7079 us | 0.0388 us | 0.4997 | 0.0038 | 6.14 KB |
| JsonCons.JsonElement | 3.348 us | 0.4197 us | 0.0230 us | 0.5836 | 0.0038 | 7.16 KB |
| Hyperbee.JsonNode | 3.587 us | 1.1927 us | 0.0654 us | 0.7629 | - | 9.64 KB |
| JsonEverything.JsonNode | 12.860 us | 6.6350 us | 0.3637 us | 2.4414 | 0.0610 | 29.98 KB |
| JsonCraft.JsonElement | NA | NA | NA | NA | NA | NA |
| Newtonsoft.JObject | NA | NA | NA | NA | NA | NA |
| | | | | | | |
| $..book[?@.price == 8.99 && @.category == 'fiction']
| Hyperbee.JsonElement | 3.599 us | 1.1407 us | 0.0625 us | 0.6752 | 0.0038 | 8.28 KB |
| Hyperbee.JsonNode | 4.593 us | 2.6977 us | 0.1479 us | 0.9460 | - | 11.91 KB |
| JsonCons.JsonElement | 4.684 us | 3.2355 us | 0.1774 us | 0.6866 | - | 8.48 KB |
| JsonEverything.JsonNode | 17.000 us | 14.9488 us | 0.8194 us | 3.1738 | - | 39.52 KB |
| JsonCraft.JsonElement | NA | NA | NA | NA | NA | NA |
| Newtonsoft.JObject | NA | NA | NA | NA | NA | NA |
| | | | | | | |
| $..book[0,1]
| JsonCraft.JsonElement | 2.184 us | 1.1145 us | 0.0611 us | 0.2518 | - | 3.09 KB |
| Hyperbee.JsonElement | 2.316 us | 0.6324 us | 0.0347 us | 0.4158 | - | 5.1 KB |
| JsonCons.JsonElement | 2.973 us | 3.2806 us | 0.1798 us | 0.4921 | 0.0038 | 6.06 KB |
| Hyperbee.JsonNode | 3.363 us | 2.4201 us | 0.1327 us | 0.7019 | 0.0038 | 8.64 KB |
| Newtonsoft.JObject | 4.709 us | 1.1244 us | 0.0616 us | 1.1749 | 0.0458 | 14.45 KB |
| JsonEverything.JsonNode | 11.585 us | 1.1525 us | 0.0632 us | 2.1362 | 0.0610 | 26.41 KB |
| | | | | | | |
| $..book[0]
| JsonCraft.JsonElement | 2.097 us | 0.7390 us | 0.0405 us | 0.2441 | - | 3 KB |
| Hyperbee.JsonElement | 2.417 us | 0.4037 us | 0.0221 us | 0.4158 | - | 5.1 KB |
| JsonCons.JsonElement | 2.767 us | 1.0765 us | 0.0590 us | 0.4539 | 0.0038 | 5.59 KB |
| Hyperbee.JsonNode | 3.439 us | 2.6110 us | 0.1431 us | 0.7019 | - | 8.64 KB |
| Newtonsoft.JObject | 4.730 us | 0.4614 us | 0.0253 us | 1.1673 | 0.0381 | 14.33 KB |
| JsonEverything.JsonNode | 11.404 us | 1.6551 us | 0.0907 us | 2.0752 | 0.0610 | 26.02 KB |
| | | | | | | |
| $.store..price
| Hyperbee.JsonElement | 2.174 us | 0.2046 us | 0.0112 us | 0.3853 | - | 4.73 KB |
| JsonCraft.JsonElement | 2.174 us | 0.9541 us | 0.0523 us | 0.2518 | - | 3.13 KB |
| JsonCons.JsonElement | 2.657 us | 1.2199 us | 0.0669 us | 0.4539 | - | 5.57 KB |
| Hyperbee.JsonNode | 3.219 us | 1.6130 us | 0.0884 us | 0.6828 |
Related Skills
openhue
338.7kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
338.7kElevenLabs text-to-speech with mac-style say UX.
weather
338.7kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
