Yes, SHA256 is faster than MD5 only if you have hardware accelleration. But SHA256 itself is pretty slow compared to the state of the art. For example, BLAKE3 is just as secure as SHA256 but an order of magnitude faster.
Try this on your own system:
$ head -c 1000000000 /dev/urandom > random-1gb
$ time md5sum random-1gb
ef72a3616aad5117ddf40a7d5f5d0162 random-1gb
real 0m2.428s
user 0m2.192s
sys 0m0.202s
$ time sha256sum random-1gb
ec7d7f31c4489acae8328fddbe54157f1cb9e97b220ef502a07e1f9230969310 random-1gb
real 0m3.894s
user 0m3.697s
sys 0m0.181s
$ time b3sum random-1gb
11fe11cc5721faf65369d18893d7b7631f6178b4692bc0bb03b1b180273cd384 random-1gb
real 0m0.282s !!!
user 0m0.876s
sys 0m0.124s
$ time b3sum --num-threads=1 random-1gb
11fe11cc5721faf65369d18893d7b7631f6178b4692bc0bb03b1b180273cd384 random-1gb
real 0m0.597s
user 0m0.488s
sys 0m0.107s
This is on an old Chromebook with Intel(R) Core(TM) m3-6Y30 CPU @ 0.90GHz CPU (dual core, but with hyperthreading). Note that even using only a single thread (which SHA256 and MD5 are limited to by their design), BLAKE3 is 6x as fast as SHA256 and 4x as fast as MD5.