You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -102,3 +109,13 @@ Then import it in your `main.rs` / `lib.rs` file:
102
109
#[macro_use]
103
110
externcrate json;
104
111
```
112
+
113
+
## Performance
114
+
115
+
While performance is not the main goal of this crate, it is still relevant, and it's doing pretty well in the company:
116
+
117
+

118
+
119
+
[The benchmarks](https://github.com/maciejhirsz/json-rust/blob/benches/benches/log.rs) were run on 2012 MacBook Air, your results may vary. Many thanks to @dtolnay for providing the baseline struct and test data the tests could be run on.
120
+
121
+
While this is not necessarily a be-all end-all benchmark, the main takeaway from this is that Serde parsing is much faster when parsing to a struct, since the parser knows exactly the kind of data it needs, and doesn't pay the (re)allocation costs of pushing data to a map. Also worth noting, rustc-serialize suffers since it first has to parse JSON to generic enum-based values, and only then map those onto structs.
0 commit comments