ok, first of all don't shorten Mario Galaxy like that if you want people to know what you are talking about lol, I really was like... "what's smg 1 and smg 2? sub machine gun?" for a good minute
but to your question. sadly Dolphin does on the fly shader compilation, this is an issue no matter where you play.
you have to go into the settings and set the shader settings to "Uber Shader"
that enables more perfomant shader compilation due to being multithreaded
you will still have shader stutters here and there to, there's no perfect way around it with dolphin.
but the longer you play the less shaders will need to be compiled and the smoother the game will get.