Earlier quoted context omitted.
Yup, Java is fast, but OP shared that Rust used 7 MB to do the same thing for which Java used 240 MB.
From looking at the traces, the performance difference between the two is minimal (on a per op basis). This mainly because both the Java and Rust services don't do much beyond interfacing with Redis/Tile38. The impressive and important thing is the amount of resources used in performing their tasks. With a little math you can see that I have 64GB RAM, which is plenty. What remains scarce is CPU cycles, so if I can do…
Rust is Not so Hairy
21–30 of 36 posts
Re: Rust is Not so Hairy
#22Earlier quoted context omitted.
From looking at the traces, the performance difference between the two is minimal (on a per op basis). This mainly because both the Java and Rust services don't do much beyond interfacing with Redis/Tile38. The impressive and important thing is the amount of resources used in performing their tasks. With a little math you can see that I have 64GB RAM, which is plenty. What remains scarce is CPU cycles, so if I can do…
Nice post. I will be really curious to see the same microservice done with Go and compare all of them.
Re: Rust is Not so Hairy
#23I have only dabbled once with Serde to generate some JSON, but I found it quite pleasant to use. Similar to Go's JSON library: You basically annotate your types like "this struct can be serialized, the field FooBar is serialized as 'foo'" etc., and Serde generates a serialize method for you (or, to be precise, it generates an implementation of some Serialize trait for your type).
Re: Rust is Not so Hairy
#24> Using protobufs meant deferring learning the various serde's of Rust, which has helped me to focus on getting something done. I have only dabbled once with Serde to generate some JSON, but I found it quite pleasant to use. Similar to Go's JSON library: You basically annotate your types like "this struct can be serialized, the field FooBar is serialized as 'foo'" etc., and Serde generates a serialize method for you…
I'll need to learn serde at some point, but it might be after a while as all the things I'm planning on doing with Rust include protobufs.
Re: Rust is Not so Hairy
#25Earlier quoted context omitted.
Being “statically-compiled” isn't some magic property that automatically makes program run faster. It can even be the opposite in some situations, since you can't benefit from JIT optimizations. What makes Rust, like C or C++, efficient is not just that they are statically compiled, it's that they have massively-tuned optimizing compiler spending a lot of time in compile-time optimizations. If you take Go, another st…
> What makes Rust, like C or C++, efficient is not just that they are statically compiled, it's that they have massively-tuned optimizing compiler spending a lot of time in compile-time optimizations. Actually lots of money spend across compiler vendors in the last 30 years, and UB abuse, as C compilers were pretty lame in the early 80's.
Re: Rust is Not so Hairy
#26Earlier quoted context omitted.
> What makes Rust, like C or C++, efficient is not just that they are statically compiled, it's that they have massively-tuned optimizing compiler spending a lot of time in compile-time optimizations. Actually lots of money spend across compiler vendors in the last 30 years, and UB abuse, as C compilers were pretty lame in the early 80's.
There was no need to "well actually" that, as it is the same point the parent was making: that money (and UB abuse) is why the tuned compilers now exist.
Re: Rust is Not so Hairy
#27A few people asked me about my experiences with Rust after I mentioned seeing significant performance improvements. I wrote a blog post about it and open sourced both the Java and Rust code.
Re: Rust is Not so Hairy
#28Earlier quoted context omitted.
Being “statically-compiled” isn't some magic property that automatically makes program run faster. It can even be the opposite in some situations, since you can't benefit from JIT optimizations. What makes Rust, like C or C++, efficient is not just that they are statically compiled, it's that they have massively-tuned optimizing compiler spending a lot of time in compile-time optimizations. If you take Go, another st…
> What makes Rust, like C or C++, efficient is not just that they are statically compiled, it's that they have massively-tuned optimizing compiler spending a lot of time in compile-time optimizations. Actually lots of money spend across compiler vendors in the last 30 years, and UB abuse, as C compilers were pretty lame in the early 80's.
That baseless assertion makes no sense. UB is a property of the ISO standard and has no effect on how compiler vendors implement the language. In fact, UB is intended to enable vendors to be free to choose how they implement that behavior. So why do you believe that the freedom to pick how you implement something hinders any development effort?
Re: Rust is Not so Hairy
#29A few people asked me about my experiences with Rust after I mentioned seeing significant performance improvements. I wrote a blog post about it and open sourced both the Java and Rust code.
Thank you for writing the article. It's very interesting and a pleasant read. Kudos!
Re: Rust is Not so Hairy
#30Earlier quoted context omitted.
If you are talking about free Java compilers that is correct. Most commercial compilers, specially those for embedded markets always had AOT native code as deployment option. But now the bad Oracle is finally making the AOT compiler research they got from Sun Labs available for free.
How does it compare against c/c++ in terms of performance ?
they do need much less RAM and startup time is _a lot_ lower though.
here it is: "Right now peak performance is a bit worse than HotSpot, but we don’t want to advertise that (and we want to fix it of course)."
http://www.graalvm.org/docs/reference-manual/aot-compilation...