View Single Post
11/24/14, 03:58 PM   #14
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Baertram View Post
I tried this zo_callLater workaround with 500ms. It is annoying as the filters won#t update after the click, but half a second later.
It seems to bring a way better performance as you switch tabs in inventories.
But only as long as you do not enable all FCOItemSaver filters (4 possible) in the inventories.
If all 4 filters are enabled each click will last for about 3 seconds again before something happens

So using the updateFlag variable is not a working workaround alone. It seems the behaviour of AdvancedFilters needs to be fixed too.
Yeah, that 500ms was just a random number I used...its obviously way to long, 100 might even be to big.
half second later...haha...that is still quicker than what I was getting pushing tab buttons without it ;P

Also yes you are right, its not a complete fix by itself, but it was like 50 times faster than without it & I was using 500ms which is waaaayyy to long. I didn't check with all 4 filters I was just doing the 1 filter like you stated.
Originally Posted by Baertram View Post
I know. I have coded everything without libFilters in some older versions of FCOItemSaver. I've changed to use libFilters as the library was stable and AdvancedFilters has used it, because then the filters registered will work all together between different addons. And this is what I want. I don't want to recode AdvancedFilters :-) But thx for the information.
I understand, but no matter what the fact that the way libFitlers does its filtering, by calling additional filter functions to check EVERY single filter on EVERY single slot to see if the item should be displayed or not means that the more filters used (by any/all addons) the more lag every addon is going to get when a filter is changed. The more filters registered, the more addons using it, the more times every single slot has to be checked when the user pushes a button.
Which is why I originally posted about how to do the filters the other way. Then you only need to handle slotUpdate to update items "as needed" when a slot is updated. When you change a filter none of the slots need to be checked because the filterData is already up to date. The change is instant.

Originally Posted by Baertram View Post
because then the filters registered will work all together between different addons.
As I said I never used libFilters or any of these addons and when I was looking at all of this I wasn't really paying attention to what was getting filtered & what wasn't, so I may be way off in my assumptions here, but from the code that I did look at...If ANY filter returns false then the item will not be displayed correct? So I don't really see how this makes different addons filters work together. That seems to me like they actually work against each other.
If you want item 1,2, & 3 to show, but not item 4, 5, & 6...your filter returns true on the first 3 & false on the next 3. But then if another addon has filters registered that does the opposite: returning false for the first 3 items & true for the last 3...Since each item had a false return somewhere, wont all of the items end up hidden? Thus your addon did not get what it wanted Items 1, 2, & 3 were hidden?


Originally Posted by Baertram View Post
Question
I do not understand why the errors in AdvancdFilters and libFilters, explained by Circonian above, don't slow down the game generally?
Because, my guess from the things that I did test...is that the problem seemed to occur (for me at least) as I continued to click buttons, the faster I clicked the worse it got. Because there are so many updates going on & it they take so long to finish running yet...as I continue pushing buttons its starting more & more updates even though the original updates haven't even finished yet. So like you said if its updating every slot 40-50 times on a single push & I push the button again before its finished, now theres 40-50 more updates running on every single slot, then push it again now 120-150 updates running on every single slot, exc...
So why doesn't it slow the game down generally? Because eventually all of those updates finish running & the lag goes away....if that's what you meant by that.



Originally Posted by Baertram View Post
Example:
If you simply use AdvancedFilters addon, maybe together with some of the plugin addons, the changing of inventory tabs is fast and smooth. Even here the unregistering and reregistering of filters take place about thousands of times and the inventory is updated many times.

But at the moment you enable FCOItemSaver addon too, together with AdvancedFilters, the game gets sloooooooooow.
Is this only because of the updating of inventory contents after each filter reregistering, and because FCOItemSaver uses extra textures inside the inventories to show the marked items?

I'm wondering why the game does not slow down markable if you simply use AdvancedFilters without FCOItemSaver?
As for that part I have no clue. I was only checking the sequence as you had stated the visible problem from, with 1 itemSaver filter on & clicking AdvancedFilter tabs. After going through libFilters & AdvancedFilters and trying to document what I found on those two I just didn't have time to look into ItemSaver. So any other connections to the problem caused by ItemSaver I didn't get a chance to look for.
Edit: As an after thought to this question, it could it possibly be what I said above..by turning on itemSaver filters as well more & more filters get registered causing more & more updates to process on every single slot.

Last edited by circonian : 11/24/14 at 04:36 PM.
  Reply With Quote