4 ms·
I can confirm that the rust version of this one is fast: playground::isOdd: testq %rdi, %rdi setg %al andb %dil, %al retq (Click ... b
by gpm 3y ago
I can confirm that the rust version of this one is fast:
playground::isOdd:
testq %rdi, %rdi
setg %al
andb %dil, %al
retq
(Click ... beside build to get assembly) https://play.rust-lang.org/?version=stable&mode=release&edition=2021&gist=5e7bf681bcfd27ddf9916ebf4e113b1c https://play.rust-lang.org/?version=stable&mode=release&edit...
Unfortunately the go playground doesn't seem to support emitting assembly?
- bilinguliar 3y agoShameless plug to claim Rust superiority!1 No, Go playground can not do that :(
- jeroenhd 3y agohttps://godbolt.org/ https://godbolt.org/ supports emitting assembly for Go while Google's tools catch up!
- gpm 3y agoGood point! Neither gc nor gccgo -O seem to figure this function out :( https://godbolt.org/z/eMv41nc6Y https://godbolt.org/z/eMv41nc6Y Proof, that you must use rust if you want blazingly fast execution of fearlessly pessimized code!
- bilinguliar 3y agoThis commands an issue in the Go repo!