I sped up serde_json strings by 20%
purplesyringa.moe
I sped up serde_json strings by 20%
1–10 of 124 posts
Re: I sped up serde_json strings by 20%
#2Re: I sped up serde_json strings by 20%
#3I’m all for code reuse but Serde for json is a bit of a dogs breakfast when it comes to dependencies. all you need is an exploit in on of those dependencies and half of the rust ecosystem is vulnerable.
Rust should have Jason built in.
Re: I sped up serde_json strings by 20%
#4Re: I sped up serde_json strings by 20%
#5Serde json has 3gb of dependencies once you do a build for debug and a build for release. Use serde on a few active projects and you run out of disk space. I don’t know why json parsing needs 3gb of dependencies. I’m all for code reuse but Serde for json is a bit of a dogs breakfast when it comes to dependencies. all you need is an exploit in on of those dependencies and half of the rust ecosystem is vulnerable. Rust…
indexmap = { version = "2.2.3", optional = true }
itoa = "1.0"
memchr = { version = "2", default-features = false }
ryu = "1.0"
serde = { version = "1.0.194", default-features = false }
I don’t think you’re measuring what you think you’re measuring when you say it has 3GB of dependencies. But I can’t say for sure because you don’t provide any evidence for it, you just declare it as true.If I were to guess, I’d say you’re doing a lot of #[derive(Serialize, Deserialize)] and it’s generating tons of code (derive does code generation, after all) and you’re measuring the total size of your target directory after all of this. But this is just a guess… other commenters have shown that a simple build produces code on the order of tens of MB…
Re: I sped up serde_json strings by 20%
#6Serde json has 3gb of dependencies once you do a build for debug and a build for release. Use serde on a few active projects and you run out of disk space. I don’t know why json parsing needs 3gb of dependencies. I’m all for code reuse but Serde for json is a bit of a dogs breakfast when it comes to dependencies. all you need is an exploit in on of those dependencies and half of the rust ecosystem is vulnerable. Rust…
Here is my test:
Cargo.toml
[package]
name = "serde-test"
version = "0.1.0"
edition = "2021"
[dependencies]
serde = { version = "1.0.208", features = ["derive"] }
serde_json = "1.0.127"
src/main.rs use serde::Deserialize;
#[derive(Deserialize)]
struct Foo {
bar: String,
}
fn main() {
let foo: Foo = serde_json::from_str("\"bar\": \"baz\"").unwrap();
println!("{}", foo.bar);
}
$ cargo build && cargo build --release && du -sh target ...
78M targetRe: I sped up serde_json strings by 20%
#7Re: I sped up serde_json strings by 20%
#8Serde json has 3gb of dependencies once you do a build for debug and a build for release. Use serde on a few active projects and you run out of disk space. I don’t know why json parsing needs 3gb of dependencies. I’m all for code reuse but Serde for json is a bit of a dogs breakfast when it comes to dependencies. all you need is an exploit in on of those dependencies and half of the rust ecosystem is vulnerable. Rust…
https://lib.rs/crates/humphrey_json
Re: I sped up serde_json strings by 20%
#9awesome that serde moves so quickly. i just ran across simdutf8 and realized the pr for simd-enabled uft8 parsing is coming up on 5 years: https://github.com/rust-lang/rust/issues/68455
Re: I sped up serde_json strings by 20%
#10Serde json has 3gb of dependencies once you do a build for debug and a build for release. Use serde on a few active projects and you run out of disk space. I don’t know why json parsing needs 3gb of dependencies. I’m all for code reuse but Serde for json is a bit of a dogs breakfast when it comes to dependencies. all you need is an exploit in on of those dependencies and half of the rust ecosystem is vulnerable. Rust…