3 ms·
The C version uses OpenMP, while the Rust version doesn't. I tried running the C code with 2 and 4 threads, wall-time and CPU time don't change much in either
by FartyMcFarter 6y ago
The C version uses OpenMP, while the Rust version doesn't.
I tried running the C code with 2 and 4 threads, wall-time and CPU time don't change much in either case which is strange (this is cygwin with gcc 10.2.0):
2 threads:
$ /usr/bin/gcc -pipe -Wall -O3 -fomit-frame-pointer -march=ivybridge -fopenmp fasta.c -o fasta.gcc-2.gcc_run && time ./fasta.gcc-2.gcc_run 25000000 | md5sum
fd55b9e8011c781131046b6dd87511e1 *-
real 0m0.724s
user 0m1.468s
sys 0m0.108s
4 threads:
$ /usr/bin/gcc -pipe -Wall -O3 -fomit-frame-pointer -march=ivybridge -fopenmp fasta.c -o fasta.gcc-2.gcc_run && time ./fasta.gcc-2.gcc_run 25000000 | md5sum
fd55b9e8011c781131046b6dd87511e1 *-
real 0m0.670s
user 0m1.514s
sys 0m0.046s