Go is actually pretty nice for cross-compiling, if you were to put an x86 system into your network you could still easily spit out arm64 binaries. C++ would be more complicated is my understanding to cross-build, but I think it's still possible.
Do you have enough memory on the system you are using? There's a 16GB Pi 5, the one I have is an 8GB Pi 5.
The Pi 5 has had some memory bandwidth performance tweaks too, see @geerlingguy at https://www.jeffgeerling.com/blog/2024/raspberry-pi-boosts-pi-5-performance-sdram-tuning
The Pi 5 will run hotter, and thermal throttling would be something to watch out for.
What are you using for a file system? (Network, SD card, SSD, NVMe?) The Pi 5 can be coerced into having NVMe storage which should be faster, but I failed in my attempt because of the very fiddly connectors on the NVMe cable.