I'm currently optimizing code of WarlockReminder.
In general the addon uses about 150 kb of memory, but shortly after loading (before the first garbage collection) the memory usage is huge - about 1,6 mb ! -
My first thought was that the garbage collection wipes the Ace-Libaries which are already loaded by another addon. But on second thought I can't believe it is about 1,5 mb coming from the libaries alone.
Can you give me some hints and tips for optimizing code? What produces lots of garbage?
(I don't want you to optimize for me, I only try to get some advice ;) )
You can advise users to install all their addons in disembedded form (typically using the Curse Client and setting it in the options) so that the libraries will only be installed once and no addon will be installed with any library subfolders (there are some exceptions).
This has several benefits:
A) Faster loading time of addons - because only 1 copy of libraries are loaded, not 23 embedded copies in 23 addons.
B) More accurate recording of memory usage - instead of every addon using the first addon that loaded the library(s) and having it misreporting memory usage - and the ability to see library memory usage
C) Easier maintenance of your working copy because you will not contain the libraries - not even as externals.
This also has several disadvantages
A) Significantly harder to install/uninstall addons and figuring out their library dependencies - an external utility can be used to overcome this.
B) Bug reports due to missing libraries.