Ubuntu20 Compilation Toolchain

we’ve noticed differences in performance when running mongo that was locally built vs the one taken from

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-7.0.2.tgz

Could you elaborate what is the recommended toolchain for compiling mongodb on ubuntu20?

Thank you!