edit: this has been pointed out as incorrect, Go ints are 8 bytes on 64bit systems -- thanks for the correction!
let mut cache: Vec<usize> = (0..=target.chars().count()).collect();
let mut cache: Vec<usize> = vec![0; target.len()];
cache := make([]int, len(target)+1) for i := 0; i < len(target)+1; i++ { cache[i] = i }
So between doing more work and worse cache usage, it wouldn't be surprising if the Rust version was slower even with the faster allocator.
https://golang.org/ref/spec#Numeric_types
edit: this has been pointed out as incorrect, Go ints are 8 bytes on 64bit systems -- thanks for the correction!
which can be simplified as vs Rust usize being 8 bytes and Go int being 4 bytes as I understand it.So between doing more work and worse cache usage, it wouldn't be surprising if the Rust version was slower even with the faster allocator.