- Have a deeply recursive function in #javaScript
- Rewrite it naively in #rust
- Compile with `cargo build --release`
- Notice it is now 10× *slower*
…hmm, that wasn't what I expected!
- Have a deeply recursive function in #javaScript
- Rewrite it naively in #rust
- Compile with `cargo build --release`
- Notice it is now 10× *slower*
…hmm, that wasn't what I expected!
In case anyone has any thoughts about why the rust version could be so much slower than the javascript version, I decided to ask about it on r/rust here: https://www.reddit.com/r/rust/comments/adyd9j/why_is_the_rust_version_of_this_fn_60_slower_than/
cc: @zalandocalrissian that has links to the code
Wow, the #rust community really is amazing! I posted a fairly beginner question on r/rust just now, and within 10 minutes I got 8 comments—7 of them were attempted solutions, 6 of them were *correct* solutions, and 2 of them had full, running code samples/diffs.
And *none* of them called me dumb or implied I don't know how to program—even though I made a classic beginner mistake (solving ownership issues with excessive use of `clone()` instead of by understating my code better)
Mike Gerwitz's GNU Social Instance is a social network, courtesy of Mike Gerwitz. It runs on GNU social, version 1.2.0-beta4, available under the GNU Affero General Public License.
All Mike Gerwitz's GNU Social Instance content and data are available under the Creative Commons Attribution-ShareAlike 3.0 Unported license.