Go Back   WowAce Forums > Addon Chat > AddOn HELP!
AddOn HELP! Requests for assistance and misc bug reports go here.

Reply
 
Thread Tools
Old 08-16-2009   #1
Born_Down_Under
Newbie
 
Join Date: Nov 2008
Posts: 6
Default Garbage Collection on UI Load...

First post here so sorry in advance if it is in the wrong forums... Let me know & I'll move it, or if you are happy to do so, move it for me

Down to business...

Upon using an ever-growing collection of addons, the load-time for my ui has become increasingly long, I recently came across an out-dated addon by the name of Zoom which halts the garbage collection feature of the ui until all addons have loaded, which makes for a large decrease in load-time for the ui unfortunately as it is so out-dated it doesn't pick up more than 1/2 of my addons... I was wondering if the author of the addon is still around to maybe work on it or if there was another author willing to take it up, pending of course, on the original author's approval...

Alternatevily if an author could throw some pointers my way in updating the addon itself I would be happy to venture into the fray of addon management.
Born_Down_Under is offline   Reply With Quote
Old 08-16-2009   #2
OrionShock
Legendary Member
 
OrionShock's Avatar
 
Join Date: May 2006
Location: Arizona
Posts: 3,787
Default Re: Garbage Collection on UI Load...

have you tried using AddonLoader ?
__________________
Author of GuildCraft, SickOfClickingDailies, CursorCooldown, Broken_LFD
WoWAce Addon List WoWInterface Addon List

"I was there in the beginning... and things were very different back then" --An Echo from a time before.
OrionShock is offline   Reply With Quote
Old 08-16-2009   #3
Born_Down_Under
Newbie
 
Join Date: Nov 2008
Posts: 6
Default Re: Garbage Collection on UI Load...

Quote:
Originally Posted by OrionShock View Post
have you tried using AddonLoader ?
ty for the tip... Upon looking @ a couple of addons with the tag for addonloader & some without, I'm thinking I will just hack the ones without the tag to set them as delayed upon load, will take a little while to do though should do though the means should justify the end result.

ty again for the reply.

EDIT:

Quick question here while I play around with the toc files... Will setting every addon to have a delayed load-time other than the addon 'Zoom', which I will set to Always, is there any problem that I don't have hindsight of?

I guess in other words, which method does addonloader use to load addons?

Last edited by Born_Down_Under; 08-16-2009 at 06:16 AM.
Born_Down_Under is offline   Reply With Quote
Old 08-16-2009   #4
fyrye
Full Member
 
fyrye's Avatar
 
Join Date: Jan 2008
Posts: 132
Default Re: Garbage Collection on UI Load...

Quote:
Originally Posted by Born_Down_Under View Post
ty for the tip... Upon looking @ a couple of addons with the tag for addonloader & some without, I'm thinking I will just hack the ones without the tag to set them as delayed upon load, will take a little while to do though should do though the means should justify the end result.

ty again for the reply.

EDIT:

Quick question here while I play around with the toc files... Will setting every addon to have a delayed load-time other than the addon 'Zoom', which I will set to Always, is there any problem that I don't have hindsight of?

I guess in other words, which method does addonloader use to load addons?
What I would do is this
In the ToC, of the other addons in the line for ## OptionalDeps:
Add Addonloader, !!!Zoom!!!

In Addonloader add !!!Zoom!!!
With WoW addons, adding the ## OptionalDeps:
will load that addon prior to other addons, allowing them to take use of their functions when loaded.

As a side note, I believe WoW uses something similar for loading, as I run 324 Addons (Disembedded), Meaning the changes to LoD has changed since Zooms release.

Garbage collected: 4.95 kb, 5 attempts were made to collect garbage, loading took 10.34 seconds.
vs Loading took 10.41 seconds w/out Zoom

Cartographer_QuestInfo, PitBull 4 being the 2 largest starting up at Player_Login

Last edited by fyrye; 08-16-2009 at 07:57 AM.
fyrye is offline   Reply With Quote
Old 08-16-2009   #5
Born_Down_Under
Newbie
 
Join Date: Nov 2008
Posts: 6
Default Re: Garbage Collection on UI Load...

Quote:
Originally Posted by fyrye View Post
What I would do is this
In the ToC, of the other addons in the line for ## OptionalDeps:
Add Addonloader, !!!Zoom!!!

In Addonloader add !!!Zoom!!!
With WoW addons, adding the ## OptionalDeps:
will load that addon prior to other addons, allowing them to take use of their functions when loaded.
Aye, that was my intention once I started hacking the files...
I'm planning on making addonloader dependent on the zoom addon with all the other addons dependent on addonloader, cuts down on amount of copy/pasting plus means I don't have to use clipboard or a new notepad file to collate what I want to copy/paste
Born_Down_Under is offline   Reply With Quote
Old 08-16-2009   #6
xbeeps
Hero Member
 
Join Date: Jul 2008
Posts: 509
Default Re: Garbage Collection on UI Load...

If you make them all delayed, Zoom will have no effect. Look at the code, it's only 24 lines. All it does is hook the garbage collect function so that it doesn't do anything, then, when the PLAYER_ENTERING_WORLD event is received, it unhooks the garbage collect function so it works again, and Zoom disables itself. So if you delay your addons to load after you have "entered the world" Zoom will have no effect on them.

A better solution, in my opinion, is to search through your addon code and simply remove all the calls to collectgarbage. Lua will collect garbage when it needs to.
xbeeps is offline   Reply With Quote
Old 08-16-2009   #7
Born_Down_Under
Newbie
 
Join Date: Nov 2008
Posts: 6
Default Re: Garbage Collection on UI Load...

mmm, I pretty much changed the dependency of all addons to to load 'addonloader' first, changed addonloader to load 'zoom' first so it holds the garbage collection, it does the job though it still doesn't grab all of the garbage collection calls as the addons are still loading once the 'player has entered world' tag has fired...

Would be better to just alter that tag in 'zoom' now since I have it firing as the first addon to be loaded.

Anybody know of an event that would be good to have 'zoom' look for before it does an end call to disable itself and restart the garbage collection of the ui feature?

Going through all the addons to find the hooks for garbage collection just to remove those lines seems to be a bit of an overkill when one addond can do the job itself now that it is more or less sequential in loading ;p
Born_Down_Under is offline   Reply With Quote
Old 08-17-2009   #8
Born_Down_Under
Newbie
 
Join Date: Nov 2008
Posts: 6
Default Re: Garbage Collection on UI Load...

So in the end what I ended up doing was tagging all the addons that don't have load dependency to be dependent on addonloader, then tagged addonloader to be dependent on the addon zoom, then changed the event call for zoom from player_enter_world to CHAT_MSG_CHANNEL_NOTICE, which is the event that is called before you see 'Joined channel 1.general, etc.' when you load in... Did that to escape any addons still being loaded/memory active after the player_entered_world event... Seems to work fine, was around 35-40 seconds loading down to 10-15 on average.

Wether or not it actually does work, or was just good luck on resources not being used by background applications at the time... It seems to be doing the job atm.
Born_Down_Under is offline   Reply With Quote
Old 08-17-2009   #9
jerry
Amazing Member
 
Join Date: Jul 2006
Posts: 1,461
Default Re: Garbage Collection on UI Load...

Make a list of addons that call collectgarbage() and report the issue to the author. There is no reason for any addon to call this function without user input.
jerry is offline   Reply With Quote
Old 08-17-2009   #10
fyrye
Full Member
 
fyrye's Avatar
 
Join Date: Jan 2008
Posts: 132
Default Re: Garbage Collection on UI Load...

Quote:
Originally Posted by Born_Down_Under View Post
So in the end what I ended up doing was tagging all the addons that don't have load dependency to be dependent on addonloader, then tagged addonloader to be dependent on the addon zoom, then changed the event call for zoom from player_enter_world to CHAT_MSG_CHANNEL_NOTICE, which is the event that is called before you see 'Joined channel 1.general, etc.' when you load in... Did that to escape any addons still being loaded/memory active after the player_entered_world event... Seems to work fine, was around 35-40 seconds loading down to 10-15 on average.

Wether or not it actually does work, or was just good luck on resources not being used by background applications at the time... It seems to be doing the job atm.
Interesting how many collectgarbage calls are being made?
NASTY SIDE EFFECT with CHAT_MSG_CHANNEL_NOTICE
It does something with ReloadUI, assume constantly spams collectgarbage when you receive a message
Since it never added the message, as well when Querying memory usage of the addons, all of them returned 0

Quote:
Make a list of addons that call collectgarbage() and report the issue to the author. There is no reason for any addon to call this function without user input.
It depends really, for every object created and disposed in WoW there is some residual memory left over. Alot of authors feel the memory left over is worth the call to collectgarbage.
Though I agree, it should only be called for once the player is in the game.
Not after setting variables up during addon load process.

Curious to see what loading Zoom in libstub dependcies will do.

Last edited by fyrye; 08-17-2009 at 07:11 PM.
fyrye is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:31 AM.