Starcraft 2 lag after reinstall, expecially with firefox open

After a reinstall of starcraft 2 is a big laggy sometimes, it seems that sometimes it goes slow and then speeds up to recover. it seems that having Firefox open plays a role, but I need it to listen to something on it when I play. I didn’t have such issue before.
any idea how to fix this?