About the game I gave you, the idea is to show you how it managed to set up the base of the game and bring the variety as soon as the game starts. That way, creating the hook for the player because , well first impressions matters.
It's hard to tell what is causing performance issues. You have to debug using "process of elimination". Basically you remove one part of the game mechanics and check does it impact performance. Do that for each part you think could make problem, like try smaller levels, no enemy collisions etc. .
Maybe it is not solely performance issues but browser compatibility issues. Even if there is workaround solution I would focus on finding what it is, just so I don't make same mistake again.