Petr Novotnik
2014-09-15 06:34:36 UTC
Hello folks,
recently I've been playing around with Rust and I'm really impressed. I
like the language a lot!
While writing a program to count the number of lines in a file, I
realized it ran twice as slow as an older program I wrote in Go some
time ago. After more experiments, I've figured out that Go's speed boost
comes from an optimized function in its standard library utilizing SSE
instructions, in particular the function bytes.IndexByte
(http://golang.org/pkg/bytes/#IndexByte).
I was wondering whether Rust would ever provide such optimized
implementations as well as part of its standard library or whether it's
up to developers to write their own versions of such functions.
Maybe I just missed something, so I'm attaching the rust program:
http://pastebin.com/NfFgMNGe
And for the sake of completeness, here's the Go version I compared with:
http://pastebin.com/4tiLsRpu
Pete.
recently I've been playing around with Rust and I'm really impressed. I
like the language a lot!
While writing a program to count the number of lines in a file, I
realized it ran twice as slow as an older program I wrote in Go some
time ago. After more experiments, I've figured out that Go's speed boost
comes from an optimized function in its standard library utilizing SSE
instructions, in particular the function bytes.IndexByte
(http://golang.org/pkg/bytes/#IndexByte).
I was wondering whether Rust would ever provide such optimized
implementations as well as part of its standard library or whether it's
up to developers to write their own versions of such functions.
Maybe I just missed something, so I'm attaching the rust program:
http://pastebin.com/NfFgMNGe
And for the sake of completeness, here's the Go version I compared with:
http://pastebin.com/4tiLsRpu
Pete.