While investigating a performance issue of deserialization, I found that serde is repeating some super-inefficient thing.
Namely, it creates
serde::__private::de::Content frequently from
serde::__private::de::ContentDeserailizer by visiting it and reconstructuring, but
ContentDeserailizer has a field named
content and the type of it is
So I created a fork (kdy1/serde) and profiled the performance.
test json_deserialize ... bench: 1,226,131 ns/iter (+/- 58,655)
test json_deserialize ... bench: 339,526 ns/iter (+/- 41,530)
I got this result by invoking
cargo bench from kdy1/swc#perf.
I want to make a PR for it, but I'm not sure if it's fine to use nightly-only features from libraries like
serde and want to hear opinions about such optimizations before creating one.