Welcome to Gaia! :: View User's Journal | Gaia Journals

 
 

View User's Journal

Lanzer's Journal
Crazy fun time in server land
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






User Comments: [38]
tsupii
Community Member





Wed Jan 11, 2017 @ 10:53am


don't know anything about coding but.. i am so sure that it's gonna be a lot of fun workdaze for you sir. I say take some time to rest, for there are lot more codings for you to do in the near future emotion_awesome

edited ps.
and im actually right with your ps lol.


BleuP
Community Member





Wed Jan 11, 2017 @ 11:50am


82% is awesome! I don't have much experience with a large amount of data in my databases, but would it be easier to implement inventory worth as a user selected button?

Godspeed, lanzer!


ThanatosRising
Community Member





Wed Jan 11, 2017 @ 12:07pm


Thaaaaank you so much for doing this. As someone with a large inventory (20k+ at one point - and let me tell you, moving half of it to mules was no easy task), you have absolutely no clue how much this means to me.


Gregory Oliver Daniels
Community Member





Wed Jan 11, 2017 @ 12:22pm


Ya know, this has been one of my biggest issues, Lanzer. Thanks man. :') Bless yer heart, dude!!!

I got like, way over 1,000. It takes like so many aborts to check out my inventory, but also if I want to change my avi. I noticed that Dumpster Dive takes longer to load for me too. Not sure if that's related, but I did notice that on my mules that have less items in the main inventory (instead of storage) they are faster at loading.

However, if I have less in my main inventory, (where I can equip) even having over 1,000 items, it takes less time to load. Dunno if that's helpful or not. Thanks again!

Also, Happy New Years! *belated

Also, can't wait till there's a way to kick people off after they've been idle - like 5 minutes, in Towns 2. It puts a lot of stress on the servers & I call them afk-holes.

Some of them do it for fun.... They just go on Towns 2, then go afk for hours... It's always the same people too.

Dang laggers. zOMG! had that feature. If you ever become afk for like 5 or so minutes, the server kicks you off.

*hint hint* I hate afk'rs.... But one thing at a time... I shall be patient....


<3


Anamosa Valentine
Community Member





Wed Jan 11, 2017 @ 01:08pm


Wow, thanks so much, Lanzer! heart I'm happy that my inventory loads faster! It may not seem like a priority, but it's really very helpful for many users!


Hydro
Community Member





Wed Jan 11, 2017 @ 01:48pm


If no one else says it, I will say it: I appreciate you doing these tweaks and small improvements. A while back we had a survey (I believe Narumi gave out the raults, I will see if I can find it) that had results saying there was an interest in these little things being fixed.

Sometimes we just don't know how to report these kind of bugs or don't realize them. Which feels scary for me to say because I work in the field. sweatdrop So your efforts of going in and giving the code a tune up is so great to me even if it doesn't seem flashy.


True Karma
Community Member





Wed Jan 11, 2017 @ 03:19pm


Thank you for working on this. I know some users who have been having a hard time with this and will really happy with the change. Even though the code was giving you the old run around Susie.


Paperworm
Community Member





Wed Jan 11, 2017 @ 04:02pm


Thank you so much for your hard work, Lanzer. heart


Sevens
Community Member





Wed Jan 11, 2017 @ 04:33pm


Please rest yourself, lanzer.


MingSao
Community Member





Wed Jan 11, 2017 @ 04:57pm


THANK YOU. crying As a user with a giant inventory, I appreciate this soooo much.


DEUS P
Community Member





Wed Jan 11, 2017 @ 04:57pm


I don't really know about coding but I tried it in the past(for beginners) , can't even make simple images move cuz I messed up on the other parts of the codes. Go Gaia~! rofl

I hope y'all are doing well, drink tea and relax heart


C h a n y e o 1
Community Member





Wed Jan 11, 2017 @ 06:08pm


Thank you! heart


DogCow
Community Member





Wed Jan 11, 2017 @ 07:03pm


By is_exist() do you mean array_key_exists() ?


Nothing Yet
Community Member





Wed Jan 11, 2017 @ 07:43pm


Just wanted to thank you SO much for this! <3 It's been taking 5+ minutes for me to load my inventory, both to dress my avatar and to open the inventory itself. It was getting noticeably worse over time, and it was starting to make me really dread things like changing my avatar or opening RIGs, which was putting a damper on things. Having it load instantaneously for the
first time in years was incredible - definitely made me smile! <3
Thank you again!


Blademaster Rin
Community Member





Wed Jan 11, 2017 @ 07:47pm


This has made such a difference in loading up my inventory!! Thank you so much!

Please make sure you get some sleep and don't burn yourself out! I'm sure we're all very appreciative for all of the hard work, but it'd be awful if you just ran yourself straight into the ground.

Take care of yourself! emotion_bigheart And thank you again for these optimizations!


Chocobo Princess
Global Moderator





Wed Jan 11, 2017 @ 08:57pm


Inventory
Items Owned: 20068
Last Change: today

Thank you so much for removing the lag-inducing Inventory Worth Calculator~! I do not actually care how much my inventory is worth; it has worth to me because I can use it to dress up my avatar. The page loaded almost instantly after the improvements you made. crying I'm so impressed. Thank you again for your hard work and dedication to the site.

As others also mentioned, be sure you take care of yourself by eating well and resting adequately so you don't get burned out by all these all-nighters you've been pulling.


Toriki-chi
Community Member





Wed Jan 11, 2017 @ 09:42pm


Bless your heart and brain Lanzer. crying


Ebania
Community Member





Wed Jan 11, 2017 @ 11:05pm


"I know that this might not be on everyone's top list of things to fix..."

It definitely was for me and am grateful for this! Thank you, Lanzer.


Dying at law school! Slow to respond on Gaia.
Message me on Discord: Ebania#0022

User Image User Image
obamaurmama
Community Member





Wed Jan 11, 2017 @ 11:08pm


i love you SO MUCH for this. SO. MUCH. i don't care if i never see my inventory's supposed worth ever again if it means i can actually load my invo in a normal amount of time. i used to log on, click my avatar, go put on a pot of coffee, make some eggs or toast, EAT AND DRINK, then come back, refresh and hope it was loaded.

SO. MUCH. HAPPIER.

bless your light.


bluecherry
Community Member





Wed Jan 11, 2017 @ 11:19pm


Three cheers for lanzer, coming in and doing so much good stuff! All the bug fixing. This place has such a need for maintenance efforts.

(speaking of pagnination, will favorites get that soon? I hope so. I already hit the one page limit and can't see any further avatars as of last night. ninja )


sdrawkcab
Community Member





Wed Jan 11, 2017 @ 11:36pm


Wow! My inventory loaded in what felt like an instant! ... To load inventory or my dress up, I'd gotten used to opening a tab and just letting it sit for a while. I don't know the technical terms for this, but it would always load to basically a blank page, then I'd refresh and I'd then get to see my items actually start to load in. XD
I can't believe it's now loading in one step, let alone so quickly. Thank you!


Zyqi
Community Member





Wed Jan 11, 2017 @ 11:39pm


...and for those of us with a small inventory, it's like applying greased lightning. xd

We all appreciate your hard work. Do remember to take a break now and again tho.

(P.S. Whatever that strange link you posted in the Staff Notices was, Chrome did not like it. ^^; )


Castiel Lover
Community Member





Wed Jan 11, 2017 @ 11:49pm


THANK YOU! As a user with 30 pages, I've noticed a large difference. The page loads so quickly, now! Thank you for doing what no one else seemed to be able to achieve. I hope your fresh eyes will be able to fix the bug with inventories where items are jumbled up, too. But get some rest! No need to rush the changes. We are just happy you're back and that things are actually being solved again. Pace yourself. This isn't a race.


AstraSage
Community Member





Wed Jan 11, 2017 @ 11:54pm


As someone who knows how much pressure large arrays can make (heck, I'll definitely have to deal with them on the Thesis for my Comp. Science Major...), I bless all your work put in optimizing the Inventory Algorithms: It's been a long time since it didn't took 5 minutes to loading mine (and I'm barely over the 10k mark)...

And like always, make sure to rest well (and maybe have some tea and a filling meal) after finishing big tasks like this one. 3nodding


Ambivalently
Community Member





Thu Jan 12, 2017 @ 12:59am


heart heart heart heart heart heart heart heart heart heart heart heart
Literally are not enough heart s for this fix.

Holy crap. I kinda love you.

I take it back. I do. I love you. emotion_bigheart
I'm so glad someone is onto the little every-day-weirdo-pop-up bugs now.
It makes the site, overall, better for use.

Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

PS: Just learned you're pulling a lot of "overtime" and "late night-ers" do NOT forget to take care of yourself, too. As amazing and great as it is to see all these changes (and someone actually giving a s**t) it's still insanely important to take good care of yourself. 3nodding

(Irony of captcha: "Love-hate" ) lol


Cleocatra
Community Member





Thu Jan 12, 2017 @ 01:18am


..I thought my inventory was loading faster. I thought my internet connection was just being nice.

Jeeze, praise Lanzer!


Webmasterkat
Community Member





Thu Jan 12, 2017 @ 01:57am


Thank you so much for doing this! Freaking glorious. emotion_kirakira emotion_awesome
Also, someone else mentioned it above but the link posted in Staff Updates is wonky and won't load at all. I'm guessing it's just a url thing? I'm using firefox.


Arashisora
Community Member





Thu Jan 12, 2017 @ 03:44am


Thank you. Please, go sleep!


HCTotorro
Community Member





Thu Jan 12, 2017 @ 05:16am


OMG...Lanzer...I love you now! heart
I have over 20k items and it would literally sometimes take 10-15 minutes for my inventory to load emo
It would abort like you said, but the page itself would look it was continuing to load.
So I would have to let it hit an error screen, and then try to refresh it, only for it to endlessly load again.
It got to the point where I would have to just open it in a tab and forget about it until I eventually remembered to check it again and then it would finally be loaded.
However, I could only access my inventory for a somewhat limited time window because (I'm assuming) the inventory worth calculator would start calculating again and I'd have to wait all over again...
If you plan to introduce the calculator again, I suggest it be a button and not automatically applied to all user's unless they choose to have their worth calculated.
I, like a few others on here, do not care at all how much my inventory is worth, because I'm an item whore and plan to keep everything anyways so why care how much it's worth?

wahmbulance wahmbulance FYI, not sure if this is the cache issue you are speaking of, but I'm having trouble organizing items.
I usually move groups of items from the last page of my special tab to the very first page so that I don't have to needlessly click to the last page again in order to open them (since the inventory reloads at the first tab after opening) but when I move a group of items and click to save the change I get an error message.
I can move maybe around 5, but when I try to move 10 or more it doesn't let me.


DarkRybrin
Community Member





Thu Jan 12, 2017 @ 05:30am


Please know you're my hero. Not only was this a significant quality of life fix, but hearing the positive feedback in the forums, and people so excited about your projects and return and how you can tackle things that no one else can...It's a breath of fresh air. It's good to have you back, and thank you for tackling one of the errors that kept me from having time to access my inventory at all some days. I'd gotten so used to having to refresh over and over, over a period of several minutes, to get in.

Thank you as well for your participating in ATS, staying up late for us, and keeping Gaians informed. It's so good to have you back. It's like the Gaia I fell in love with all over again.
As for zOMG and you trying to contact Swarf, I wish you the greatest of luck. I always thought zOMG and the battle system was a core component of the Gaian experience and identity, from the soundtrack and art, to the teamwork.
You really are an amazing person. We were losing the battle for the soul of his site before you returned.


logic mom
Community Member





Thu Jan 12, 2017 @ 07:35am


Rock on! Thanks so much, Lanzer - the faster it loads, the better. Tyt figuring the invo worth, it's not really of the utmost importance when it comes to the invo.


Tsukita-chan
Community Member





Thu Jan 12, 2017 @ 01:48pm


OMG I don't even care if I can't see my invo worth... this is GREAT!
you have no idea how bad was for me every time I wanted to go to my invo or equip page... had to wait a lot just to load... was soooo annoying gonk
but now is faster and I really appreciate it!!! THANK YOU!

PS is kinda sad you had to come back to have a fix on this... oh well sweatdrop
we love you Lanzer
-pets for Waffles-


Cruxis Fiend
Community Member





Thu Jan 12, 2017 @ 02:14pm


I wonder, if it would be easier, and more efficient to port to a different language altogether (Flash is quite old and has many limitations, from what I've read.)

Still, good work, and thank you for keeping this site running! I imagine a lot of people would be rather lost without it.


Variations
Community Member





Fri Jan 13, 2017 @ 12:21am


Thank you. Good to have you back again.


Lady_Elentari
Community Member





Sat Jan 14, 2017 @ 04:23am


Calculate inventory - possible to put an ajax request behind a user action (e.g. onclick) and send the request to a distributed "calculate inventory queue"?

Not sure about the codebase, could you cache/pass around the full list of itemids and inflate the objects (600 or something at a time on the inventory page) on request?


ForestGreen
Community Member





Sat Jan 14, 2017 @ 08:15am


Thank you for your work on the inventory load times Lanzer! It's good to have you back. The load time for my inventory is negligible now and there had been times previously when it would time out a few times before it loaded. I kind of liked the inventory worth feature but I find that I don't really miss it, especially when my inventory loads as fast as it did almost 10 years and at least that many pages ago.


A Wayward Gypsy
Community Member





Mon Jan 16, 2017 @ 02:02pm


So is the 10,000 item limit temporary then?


mcghetto
Community Member





Mon Jan 23, 2017 @ 11:24pm


thanks for fixing the bugs and stuff, however will you be bringing back the inventory value's back? crying


User Image
User Comments: [38]
 
 
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum