Are you not really also testing the implementation of finding a string in a block, rather than reading. I'm presuming some of the "odd" timings may be down to how this is implemented?
For example in Rust you are using match and the haystack thing, rather than find - not enough of a Rust programmer to comment on which is better, but there does at least seem to be a choice of method.
Yes, i also think the rust bad results may come from find_subsequence impl in rust.
Indeed, it's creating a slice iterator that will generate an iterator over 65536 arrays then launch a find algorithm over the iterator.
But maybe the rust issue comes from elsewhere. We should measure.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Are you not really also testing the implementation of finding a string in a block, rather than reading. I'm presuming some of the "odd" timings may be down to how this is implemented?
For example in Rust you are using
match
and thehaystack
thing, rather thanfind
- not enough of a Rust programmer to comment on which is better, but there does at least seem to be a choice of method.Yes, i also think the rust bad results may come from
find_subsequence
impl in rust.Indeed, it's creating a slice iterator that will generate an iterator over 65536 arrays then launch a find algorithm over the iterator.
But maybe the rust issue comes from elsewhere. We should measure.