Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
renato.athaydes.com
Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
1–10 of 26 posts
Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#2Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#3The Rust code is bar far not optimized. For example while loading the dictionary, why creating a Vec and returning it instead of operating on a max word size array and reusing it. Also why not write everything at the end. I'm not a Rust Professional also, but maybe get a review by one please before benchmarking against something else.
This type of thing reminds me of the three articles ending in https://fitzgeraldnick.com/2018/02/26/speed-without-wizardry... (which has links to the first two parts of the saga), where one guy rewrote stuff in Rust for performance, another demonstrated how it was possible to make the JavaScript version faster than the Rust by some algorithm changes and by various painful and fragile tricks requiring detailed knowledge of the runtime environment, and finally the first guy applied the applicable parts of that back to the Rust, after which it handily beat the JavaScript again while also being more consistent and dependable.
Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#4The Rust code is bar far not optimized. For example while loading the dictionary, why creating a Vec and returning it instead of operating on a max word size array and reusing it. Also why not write everything at the end. I'm not a Rust Professional also, but maybe get a review by one please before benchmarking against something else.
Another point where it’s doing something that to me as a Rust expert is obviously inferior: it’s using Unicode-aware string stuff although anything non-ASCII will either be ignored (if non-alphabetic) or panic (if alphabetic). It’d certainly be better to treat the input throughout the program as a sequence of bytes rather than as UTF-8. This type of thing reminds me of the three articles ending in https://fitzgeraldn…
I'm sure if you submitted a better implementation he'd be happy to add it in.
Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#5Earlier quoted context omitted.
Another point where it’s doing something that to me as a Rust expert is obviously inferior: it’s using Unicode-aware string stuff although anything non-ASCII will either be ignored (if non-alphabetic) or panic (if alphabetic). It’d certainly be better to treat the input throughout the program as a sequence of bytes rather than as UTF-8. This type of thing reminds me of the three articles ending in https://fitzgeraldn…
The author was pretty explicit in the article that the rust implementation was suboptimal. I'm sure if you submitted a better implementation he'd be happy to add it in.
> The objective is to get the fastest implementation possible, and having optimised Java and Rust implementations to compare against is a motivator to keep going until there really isn’t anything else that can be tried!
> Do you think Common Lisp can run as fast as well-optimised Rust? Read on if you want to find out.
Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#6Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#7Re: Optimising Common Lisp to try and beat Java and Rust on phone encoding 2/2
#8And here come the Rust fan boys telling us the correct way to write the code so it will be faster than anything ever written, much safer than anything ever written and better than any programming language ever written.