|
1 | | -# JBird |
| 1 | +# JBird |
| 2 | + |
| 3 | +[](LICENSE) |
| 4 | +[](https://swift.org) |
| 5 | +[](https://developer.apple.com) |
| 6 | + |
| 7 | +A high-performance JSON parsing and manipulation library for Swift with a focus on speed, type safety, and a modern Swift API. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- ⚡️ **High Performance**: Built with a C core for optimized parsing with SIMD acceleration where available |
| 12 | +- 🛡️ **Type Safe**: Rich Swift API with proper type checking and error handling |
| 13 | +- 🧩 **Declarative**: Build JSON objects and arrays using SwiftUI-like builders |
| 14 | +- 🔄 **Swift Macros**: Utilize Swift macros for cleaner, more concise code |
| 15 | +- 📊 **Flexible API**: Easily convert between JSON and native Swift types |
| 16 | +- 🧪 **Well Tested**: Comprehensive test suite ensures reliability |
| 17 | +- 📝 **Fully Documented**: Complete DocC documentation |
| 18 | +- 🔧 **Customizable**: Extensible to fit your specific needs |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +JBird is currently distributed exclusively through the [Swift Package Manager](https://www.swift.org/package-manager/). |
| 23 | + |
| 24 | +To add JBird as a dependency to an existing Swift package, add the following line of code to the `dependencies` parameter of your `Package.swift` file: |
| 25 | + |
| 26 | +Add JBird to your `Package.swift` file: |
| 27 | + |
| 28 | +```swift |
| 29 | +dependencies: [ |
| 30 | + .package(url: "https://github.com/vsanthanam/JBird.git", from: "1.0.0") |
| 31 | +] |
| 32 | +``` |
| 33 | + |
| 34 | +Then add the dependency to your target: |
| 35 | + |
| 36 | +```swift |
| 37 | +.target( |
| 38 | + name: "YourTarget", |
| 39 | + dependencies: ["JBird"] |
| 40 | +) |
| 41 | +``` |
| 42 | + |
| 43 | +To add JBird as a dependency to an Xcode Project: |
| 44 | + |
| 45 | +- Choose `File` → `Add Packages...` |
| 46 | +- Enter package URL `https://github.com/vsanthanam/JBird.git` and select your release and of choice. |
| 47 | + |
| 48 | +Other distribution mechanisms like CocoaPods or Carthage may be added in the future. |
| 49 | + |
| 50 | +## Performance |
| 51 | + |
| 52 | +JBird is designed for high performance, with benchmarks showing it to be one of the fastest JSON parsers available for Swift. The core parsing engine is written in C with SIMD acceleration where available, making it significantly faster than pure Swift implementations. |
| 53 | + |
| 54 | +JBird demonstrates exceptional performance compared to other popular JSON parsing libraries: |
| 55 | + |
| 56 | +- **Speed**: JBird parses JSON 2-5x faster than SwiftyJSON and about 25% faster than Foundation |
| 57 | +- **Memory Efficiency**: JBird uses significantly less memory than other parsers (up to a 95% reduction) |
| 58 | +- **Resource Usage**: JBird requires dramatically fewer CPU instructions and memory allocations for equivelent payloads |
| 59 | +- **Consistent Performance**: JBird maintains its performance advantage across different JSON file sizes and formats |
| 60 | + |
| 61 | +These benchmarks were run on a variety of JSON files ranging from 64KB to 5MB, in both minified and pretty-printed formats. You can explore the comparisons with common Swift JSON libraries (Foundation, SwiftyJSON, etc.) in the `/Benchmarks` directory. |
| 62 | + |
| 63 | +## Usage & Documentation |
| 64 | + |
| 65 | +JBird's documentation is built with [DocC](https://developer.apple.com/documentation/docc) and included in the repository as a DocC archive. The latest version is hosted on [GitHub Pages](https://pages.github.com) and is available [here](https://usejbird.com/docs/documentation/jbird). |
| 66 | + |
| 67 | +Additional installation instructions are available on the [Swift Package Index](https://swiftpackageindex.com/vsanthanam/JBird) |
| 68 | + |
| 69 | +[](https://swiftpackageindex.com/vsanthanam/JBird) |
| 70 | +[](https://swiftpackageindex.com/vsanthanam/JBird) |
| 71 | + |
| 72 | +Explore [the documentation](https://usejbird.com/docs/documentation/jbird) for more details. |
| 73 | + |
| 74 | +## License |
| 75 | + |
| 76 | +**JBird** is available under the [MIT license](https://en.wikipedia.org/wiki/MIT_License). See the [LICENSE](https://github.com/vsanthanam/JBird/blob/main/LICENSE) file for more information. |
0 commit comments