Skip to content

Commit

Permalink
chore: update to zig version 0.14.0
Browse files Browse the repository at this point in the history
also update readme
  • Loading branch information
travisstaloch committed Mar 5, 2025
1 parent 5ec9fae commit 826c400
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The main branch is meant to compile with zig's master branch. It is tested week
For older compiler versions, use a [tagged version](https://github.com/travisstaloch/simdjzon/tags).

# usage
### Git Clone
```console
# json validation
$ git clone https://github.com/travisstaloch/simdjzon
Expand All @@ -63,6 +64,26 @@ $ zig build test
All 19 tests passed.
```

### Zig Package
```console
$ $ zig fetch --save git+https://github.com/travisstaloch/simdjzon
info: resolved to commit 28d46c979f761b211539232378138b692ef50d55
```
```zig
// build.zig
const simdjzon_dep = b.dependency("simdjzon", .{ .target = target, .optimize = optimize });
const exe_mod = b.createModule(.{
// ...
.imports = &.{
.{ .name = "simdjzon", .module = simdjzon_dep.module("simdjzon") },
},
});
```
```zig
// main.zig
const simdjzon = @import("simdjzon");
```

```zig
const dom = @import("dom.zig");
test "get with struct" {
Expand Down Expand Up @@ -178,6 +199,7 @@ $ echo $?
### timed against simdjson, go, nim, zig std lib
The simdjson binary was compiled as shown above. Go and nim binaries created with sources from JSONTestSuite. [zig std lib driver](bench/src/zig_json.zig).
Validation times for several large json files. Created with [benchmark_and_plot.jl](bench/benchmark_and_plot.jl)

![results](https://github.com/travisstaloch/simdjson-zig/blob/media/bench/validation_grouped.png)

# JSONTestSuite
Expand Down
7 changes: 7 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.{
.name = .simdjzon,
.version = "0.0.1",
.fingerprint = 0xc4994cf38052e3ee,
.dependencies = .{},
.paths = .{"."},
}

0 comments on commit 826c400

Please sign in to comment.