Unreal editor can recompile without closing it, but if the change is big, it's better to close the editor and recompile the game. Unity can have long compiling times, but I haven't experienced in the time that I used it