In a world where processes can fork-and-exec, nothing about "as a service" changes that. The compiler would just be reinvoked as needed. Converting it into a persistent process breaks a lot more than just allocation optimizations.
But you want to share state and only update state incrementally on edit to get any reasonable level of performance for stuff like language server code analysis.