It’s probably not compilation, but “Domain Reloading” (https://docs.unity3d.com/2022.2/Documentation/Manual/DomainR...) which is laughably slow and on by default.
I think Unity does this because the same process is re-used for Play and Editor modes, whereas Godot does the normal thing and spawns a new process when testing.