That doesn't mean much. The worst offender I've seen has been LibRock. And it wasn't a badly written library overall. But doing looping calls to collectgarbage() was a bad idea.
But the mistake that is made by all the addons (that automatically call collectgarbage() as part of their loading/execution process) is that they assume they know what the user lua heap is and that they are important enough to allow themselves to hang your computer while they do their cleanup.
It's even worse for big database addons. collectgarbage() will traverse all lua objects. If you have to scrutinize hundreds of megabytes of data in order to reclaim half a meg of garbage, then it's gonna take a lot of time for no much difference. Database addons are really the ones that should be extremely picky about creating garbage and calling collectgarbage(), as they add a lot of processing time to it themselves with their huge amount of data that's never gonna get reclaimed ever, but is scanned nonetheless each time.
The WoW client does not enforce any addon loading order. Addons are loaded in the order the file subsystem returns folder entries.
Under Windows, this happens to be based on the folder names using ASCII order. This way addons named like "!!Zoom" are loaded before other addons.
Under Linux, and I think under MacOS too, this is not based on folder names. From our POV, it is undefined so "!!Zoom" is not loaded first.
Under Windows, this happens to be based on the folder names using ASCII order. This way addons named like "!!Zoom" are loaded before other addons.
This is not a Windows specific behavior.
Loading addons in alphabetical order only occurs on NTFS file systems, because the file system stores entries using a sorted binary tree, so asking for a list of folders in the addons folder gets them in alphabetical order.
If the hard disk was formatted using FAT32 instead, then the order of loading of addons would be based on the order each folder was in the FAT (file allocation table). Usually this tended to be in the order of the date of creation as entries are added to the end of the table. A defragment utility can change the load order by cleaning up the FAT and reorder the files.
It just so happens that the default file system of almost all Windows installations uses NTFS.
I'm running XP Pro x86, under an NTFS partition, I forget cluster size I believe it's 16.
I have several drives, the drive with WoW's installation is setup as RAID 5 (stripped w/ parity). All 3 disks are SATA II, and the the raid controller is hardware using an ACCUSYS drive bay.
And am familiar with loading order under NTFS partitions.
For some reason until I added !!!Zoom!!! as a dependency I was missing 2 collectgarbage calls. Added it to LibStub, Ace2, and LibRock, and picked up 2 more. *shrug*
I never expected this sort of discussion to come from my little issue with my pos ('03 plus bits & pieces, model) pc & the load times from having addons, which have seemingly gone from 45 seconds to 1 minute, down to 25-45 seconds with 4 or 5 collectgarbage calls interrupted during load.
As for me, I'd like to consider myself an experienced addon user, due to my experience of lua coding being pretty much = nil; (Though I do tend to learn things on-the-fly)
The issue is that you would have addon authors that believe they have the right to do so (justifiably so imo as they are the authors), just to try & keep memory useage down from their addon & or doing so merely for the want to claim a smaller than actual footprint!?
Those same authors when given the suggestion are most likely going to turn around & tell you to go point you towards the nearest cliff as they wrote the addon & they know better, at least coming from my pov as an addon user not author (Same crap happens in rl with people thinking they know better than others, even if it is clear they are mis-informed on the subject)
I'm guessing that the core concern is true for all addon users, any addon using the 'collectgarbage' call to effectively clean its own mess before the igc feature in wow does, really should not be doing so as the system can & does do the job quite well in comparison to vanilla wow...
Addons started out to enhance the ui of wow which was woefully lacking, these days seemingly turning towards automatic features to cut out the micro-management needed for some aspects of the game (automatic weapon swap, dismount/mount, quest accept/completion, etc)
In saying that, how is it possible to set a precedent of sorts when every addon starts off by an individual & his/her own concepts of coding habits?
Particularly when the environment of wow is changing, bringing along players that decide to turn authors due to frustration @ an aspect of the game or lack of... It's either going to end being a copy/paste rip-off of coding or it's going to be code that will inherit their own habits, wether they be good or bad.
If you don't care about mem usage, why do you care about cpu usage?
Well, I care because an addon using excessive CPU cycles will noticeably impact my game's performance long before an addon using excessive KB or even MB of RAM will, especially on modern systems with 2+ GB of RAM.
That doesn't mean much. The worst offender I've seen has been LibRock. And it wasn't a badly written library overall. But doing looping calls to collectgarbage() was a bad idea.
But the mistake that is made by all the addons (that automatically call collectgarbage() as part of their loading/execution process) is that they assume they know what the user lua heap is and that they are important enough to allow themselves to hang your computer while they do their cleanup.
It's even worse for big database addons. collectgarbage() will traverse all lua objects. If you have to scrutinize hundreds of megabytes of data in order to reclaim half a meg of garbage, then it's gonna take a lot of time for no much difference. Database addons are really the ones that should be extremely picky about creating garbage and calling collectgarbage(), as they add a lot of processing time to it themselves with their huge amount of data that's never gonna get reclaimed ever, but is scanned nonetheless each time.
The WoW client does not enforce any addon loading order. Addons are loaded in the order the file subsystem returns folder entries.
Under Windows, this happens to be based on the folder names using ASCII order. This way addons named like "!!Zoom" are loaded before other addons.
Under Linux, and I think under MacOS too, this is not based on folder names. From our POV, it is undefined so "!!Zoom" is not loaded first.
This is not a Windows specific behavior.
Loading addons in alphabetical order only occurs on NTFS file systems, because the file system stores entries using a sorted binary tree, so asking for a list of folders in the addons folder gets them in alphabetical order.
If the hard disk was formatted using FAT32 instead, then the order of loading of addons would be based on the order each folder was in the FAT (file allocation table). Usually this tended to be in the order of the date of creation as entries are added to the end of the table. A defragment utility can change the load order by cleaning up the FAT and reorder the files.
It just so happens that the default file system of almost all Windows installations uses NTFS.
I have several drives, the drive with WoW's installation is setup as RAID 5 (stripped w/ parity). All 3 disks are SATA II, and the the raid controller is hardware using an ACCUSYS drive bay.
And am familiar with loading order under NTFS partitions.
For some reason until I added !!!Zoom!!! as a dependency I was missing 2 collectgarbage calls. Added it to LibStub, Ace2, and LibRock, and picked up 2 more. *shrug*
I never expected this sort of discussion to come from my little issue with my pos ('03 plus bits & pieces, model) pc & the load times from having addons, which have seemingly gone from 45 seconds to 1 minute, down to 25-45 seconds with 4 or 5 collectgarbage calls interrupted during load.
As for me, I'd like to consider myself an experienced addon user, due to my experience of lua coding being pretty much = nil; (Though I do tend to learn things on-the-fly)
The issue is that you would have addon authors that believe they have the right to do so (justifiably so imo as they are the authors), just to try & keep memory useage down from their addon & or doing so merely for the want to claim a smaller than actual footprint!?
Those same authors when given the suggestion are most likely going to turn around & tell you to go point you towards the nearest cliff as they wrote the addon & they know better, at least coming from my pov as an addon user not author (Same crap happens in rl with people thinking they know better than others, even if it is clear they are mis-informed on the subject)
I'm guessing that the core concern is true for all addon users, any addon using the 'collectgarbage' call to effectively clean its own mess before the igc feature in wow does, really should not be doing so as the system can & does do the job quite well in comparison to vanilla wow...
Addons started out to enhance the ui of wow which was woefully lacking, these days seemingly turning towards automatic features to cut out the micro-management needed for some aspects of the game (automatic weapon swap, dismount/mount, quest accept/completion, etc)
In saying that, how is it possible to set a precedent of sorts when every addon starts off by an individual & his/her own concepts of coding habits?
Particularly when the environment of wow is changing, bringing along players that decide to turn authors due to frustration @ an aspect of the game or lack of... It's either going to end being a copy/paste rip-off of coding or it's going to be code that will inherit their own habits, wether they be good or bad.
Anyway:
Memory usage is important! (system dependent!)
If you don't care about mem usage, why do you care about cpu usage?
Well, I care because an addon using excessive CPU cycles will noticeably impact my game's performance long before an addon using excessive KB or even MB of RAM will, especially on modern systems with 2+ GB of RAM.
What relevance does this example have for a discussion about using collectgarbage in normal addons???