4 ms·
Just my 2c -- it is a potentially interesting article, but two things have to be fixed: 1. Compile C version with better optimization flags or ask an expert to
by ptero 10y ago
Just my 2c -- it is a potentially interesting article, but two things have to be fixed:
1. Compile C version with better optimization flags or ask an expert to tweak it for faster performance.
2. Include sample run on some known / meaningful data to test that software runs correctly (not only fast).
IMO rust doesn't have to be faster than C to make a valuable article. If it is as fast or almost as fast it is still a good data point.
- tom_mellior 10y ago> Compile C version with better optimization flags or ask an expert to tweak it for faster performance. Part of the point they are trying to make is that you don't need to be an expert to reap performance benefits in certain languages. They explicitly state that they did not do things that C experts would know how to do. This is pretty reasonable in the context of astrophysics. The whole idea of the thing is that if there is a language that allows you to write faster code than C without having to "ask an expert to tweak it", you will be more productive using that language. That said, your point 2 is entirely valid; the paper fails to demonstrate pretty much all of its claims, and it never makes a case for needing Rust's safe dynamic memory allocation features in a program that doesn't use dynamic allocation at all. For whatever it's worth, the astrophysicists I most recently talked to wrote their simulations in Python (with SciPy or similar) or even something called IDL: https://en.wikipedia.org/wiki/IDL_(programming_language) https://en.wikipedia.org/wiki/IDL_(programming_language) and they also tend to have mad Bash skills for glueing different data-processing programs together.
- ptero 10y agoYou have a good criticism on my #1. I should drop "ask the expert" part but still maintain that when writing numerical computation software checking for compile flags is a reasonable request. Leave code as is, but still try -O3 / -Ofast. At this point it is not the language expertise, but knowing about your tools.
- tom_mellior 10y agoAgreed, mostly :-) The paper does state that they used -O3.
- burntsushi 10y ago> Rust's safe dynamic memory allocation features Rust's safety features aren't tied at all to dynamic memory allocation. You can write a Rust program with pointers (into the stack, for example) with no dynamic memory allocation at all and still benefit immensely from the safety features.
- 542458 10y ago> meaningful data to test that software runs correctly It appears that it doesn't run correctly (rust optimizes out the actual integration, and values are all set to NaN!) https://github.com/marblestation/benchmark-leapfrog/issues/6 https://github.com/marblestation/benchmark-leapfrog/issues/6