Tonight my goal is to fix the slowness of inventory for all users with a large inventory. I know that this might not be on everyone's top list of things to fix, but I can't imagine any Gaian having to take minutes just to see their inventory.
After having some fun tracing through inventory listings, I found that sorting through inventory ended up taking more than 30 seconds, causing the code to abort entirely.
Lucky for me, turns out there are parts in our database code that can be optimized. (use is_exist() instead of in_array() everyone!) The optimized code ran 82% faster now!
Just when I thought things are okay, then came ANOTHER fatal error... The feature to calculate your inventory's worth is exhausting the system's memory to the point where the code aborts!
For now I'll turn off the inventory worth feature for any accounts that are bigger than 1000 items in size. I should be able to find a way to speed up the feature, but for now...
There is yet ANOTHER error! This time the memory caching code couldn't handle such a large inventory and end up aborting. To fix this I'll need to disable caching for large inventories, and for long term I'll need to split the data up before caching. This is gonna be fun... sweatdrop
Hopefully, starting tomorrow everyone will be able to access their inventories in a timely manner. Also hoping that I can wrap up in 2 hours. rofl
PS - nope, took 3 hours. gonk
Found out that some flash features also pull the entire inventory and eventually hit a memory limit and stopped. Solution for now is to add a limit of 10000 items. Will probably add pagination once we have the resources to change the flash code. Man, that's another hour. I really need to go sleep
View User's Journal
Lanzer's Journal
User Comments: [38]
User Comments: [38]