{"by":"pcwalton","id":9146272,"kids":[9146506,9147155,9154007],"parent":9146206,"text":"Just one glance at the Rust version (e.g. [1]) shows a lot of needless allocation. For example:<p><pre><code> if *strn == "&".to_string() { ... }\n</code></pre>\nis a very slow (and verbose) way to write<p><pre><code> if &strn[..] == "&" { ... }\n</code></pre>\nand<p><pre><code> rr_string("'".to_string() + k.to_string() + "' not found".to_string())\n</code></pre>\nis a very slow (and verbose) way to write<p><pre><code> rr_string(format!("'{}' not found", k))`\n</code></pre>\nEtc. etc.<p>[1]: <a href=\"https://github.com/kanaka/mal/blob/master/rust/src/env.rs\" rel=\"nofollow\">https://github.com/kanaka/mal/blob/master/rust/src/env.rs</a>","time":1425493838,"type":"comment"}