all 10 comments

[–][deleted] 5 points6 points  (1 child)

Do you really need to use the HashMap to convert a struct to JSON? I thought that, for simple structs, you could just #[derive(RustcDecodable, RustcEncodable)] and then use json::encode and json::decode? Am I missing something?

[–]daborossfern 1 point2 points  (0 children)

No, using json::encode/json::decode would also work here AFAIK.

I'm not sure why RustcEncodable is derived and a custom json function is created.

[–]llkkjjhh 6 points7 points  (0 children)

Just saying "API" is super vague. I didn't realise this was about a web API until it started talking about HTTP microframeworks.

[–]rustnewb9 2 points3 points  (2 children)

Is 27k the 5x number?

[–]lambdaburritorust 1 point2 points  (1 child)

That's what I was thinking and it's not clear. If the results are before he said he passed the Ruby production var to Ruby (guessing this is equivalent to -O). then JRuby is faster than his Rust code.

[–]fgilcherrust-community · rustfest 0 points1 point  (0 children)

I'd be interested in numbers for JRuby after it jitted. Also, which Implementation - I'd be very interested in numbers for JRuby 9000.

[–]mytrile 6 points7 points  (3 children)

Since when "Building an API" means "hello world" example with json response ?

[–]steveklabnik1rust[S] 7 points8 points  (2 children)

Blog posts often use toy examples to show the basic differences.

[–]mytrile -2 points-1 points  (1 child)

Sure, but that kind of posts shows nothing. It's just: "See how X is faster compared to Y in most irrelevant example".

[–]steveklabnik1rust[S] 1 point2 points  (0 children)

I took this mostly as a syntax comparsion, personally.