> Rust: build with --release. 10X performance boost!
That might mean that Rust would top the charts instead of Nim.
[1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
> Rust: build with --release. 10X performance boost!
That might mean that Rust would top the charts instead of Nim.
[1]: https://github.com/kanaka/mal/commit/434516e0d172904e06b05f6...
if *strn == "&".to_string() { ... }
is a very slow (and verbose) way to write if &strn[..] == "&" { ... }
and rr_string("'".to_string() + k.to_string() + "' not found".to_string())
is a very slow (and verbose) way to write rr_string(format!("'{}' not found", k))`
Etc. etc.[1]: https://github.com/kanaka/mal/blob/master/rust/src/env.rs
EDIT: further, looks like it's on a really old Rust: https://github.com/kanaka/rust-pcre wasn't updated since October...
EDIT 2: I tried to update the code, but it's really, really out of date, and will be a ton of work. So I've just submitted https://github.com/kanaka/mal/pull/23 instead. :(
The reason it still uses the alternate pcre is because this still hasn't been fixed: https://github.com/rust-lang/regex/issues/28 I would love to get rid of that nastiness.
UPDATE: I will point out that the README is pretty clear that this is rust 0.13. Doesn't mean it's a good representation of rust 0.13 either of course, but it clearly isn't based on a recent version of Rust.
For that matter: the constructive part was in the other post where he suggested some improvements. I can understand if the pull request is seen as aggressive, though.
Have I mentioned how much I can't wait until 1.0.0 actually ships?
That did seem rather inefficient at the time but I wasn't able to discern the more efficient method at the time. I've kind of been waiting for Rust 1 to cycle back around. But I'll see if I might be able to address some of those and bump to Rust 1.0 alpha in the next few days.
Note the conversation about performance is kind of unfortunate. Those numbers should be considered VERY rough (they were just a personal notes file of mine). Also, with --release, the numbers place rust in the same range as other compiled languages.
But if you want to take another pass through the code now that it's not based on an ancient Rust version, I'm always happy to take any advice from the master. :-)
[ed: Also interesting to note that the clojure version is much slower than scala/java. If nothing else, I guess it's an indication of performance gains that can be had by implementing parts of a clojure program in java (unless there's something off with the clojure implementation, of course.]
Lua does seem to be an odd one in that the short tests run quickly but this does not translate into iterations for the longer 10 second test. Perhaps the mal implementation is triggering bad GC behavior or something and that drags down the longer running tests. That's just speculation though. Again, please take the numbers with a mountain size grain of salt.
There is this misunderstanding between implementations and languages where people equate whatever they have installed on their computer with all implementations of the said language.
Also not knowing about profilers and optimization flags.
So yeah, it is sad.
$ rustc --release prog.rs
error: Unrecognized option: 'release'.
There is a -O for optimization, it is equivalent to -C opt-level=2.EDIT: Oh, cargo build does have a --release which seems to be equivalent to -C opt-level=3, which I guess is even better.
Alternatively, don't have a default and let people opt-in to whatever default they like. That forces people to actually make a choice, instead of being lazy and publishing poor benchmarks without having even looked up what optimization knobs there are to turn on or off.