Maybe with some heuristics, you could hide some latency by beginning to compile before saving.
I hear you can get this working with vim/neovim but I haven’t done it myself.
I have therefore developed a reflex where I hit Cmd-S every time I finish typing. I actually have to put conscious effort in to stop this when using software where saving is slow.