Optimize Dex#getEffect by caching the result. (#5181)
Optimize Dex#getEffect by caching the result. (#5181)

As outlined by pkmn.cc/optimize, this change should result in a ~30%
increase in Battle performance over repeated runs. Caching the
resultant effect is safe provided nothing mutates it.
svivian/Pokemon-Showdown,Enigami/Pokemon-Showdown,Zarel/Pokemon-Showdown,svivian/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,AustinXII/Pokemon-Showdown,Enigami/Pokemon-Showdown,AustinXII/Pokemon-Showdown,QuiteQuiet/Pokemon-Showdown,xfix/Pokemon-Showdown,Enigami/Pokemon-Showdown,panpawn/Gold-Server,QuiteQuiet/Pokemon-Showdown,Zarel/Pokemon-Showdown,svivian/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,panpawn/Gold-Server,AustinXII/Pokemon-Showdown,Zarel/Pokemon-Showdown,xfix/Pokemon-Showdown,jumbowhales/Pokemon-Showdown,urkerab/Pokemon-Showdown,xfix/Pokemon-Showdown,Enigami/Pokemon-Showdown,svivian/Pokemon-Showdown,panpawn/Gold-Server,QuiteQuiet/Pokemon-Showdown,jumbowhales/Pokemon-Showdown,urkerab/Pokemon-Showdown,xfix/Pokemon-Showdown,sirDonovan/Pokemon-Showdown,jumbowhales/Pokemon-Showdown,svivian/Pokemon-Showdown,xfix/Pokemon-Showdown,urkerab/Pokemon-Showdown