-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve loading experience #65
Comments
Application cache might be good here.... |
That would help with subsequent loads, but browser http caching should do that anyway. I'm thinking mostly of the initial load. |
The biggest thing (besides images) is the zip js. So if you went back to initiating the initial theme images from css and not a zip then you wouldnt need to wait for that to load before showing winamp (plus the unzipping is going to take a tiny bit o time). Then really the only big stuff is the images and if you turn those bmp to pngs (havent tried gif yet, which they could be as they all seem to be 256 colours) the theme ends up being 83k including the text files. And once you combine and minify the rest shouldnt be much. |
The zip file, while large, actually improves the transfer (compared to th the raw bmps) since it's compressed. It's only about 100k and means we only need one connection. I think the main problem is that the download of the zip is blocked by the download of everything else, including the zip library. Ideally the zip library and the skin zip (and even lama.mp3) should be able to be fetched in parallel. I think there are some tricks where you basically request the file at the top of the html file. Then, later on, when we actually want it the browser has it in it's cache so it loads instantly. Jordan Eldredge Please excuse any typos or terseness; this email was sent from a mobile device.
|
Just nick picking.....unless your on a real slow computer or something like a tablet/phone in which case the unzipping, converting to base64 to put in the css and then the decoding of the base64 to display could actually make it worse, maybe. This is going on some stuff that showed base64 in the css could actually be slower than if it had to do multiple requests. Want one download with no converting, you could create one big sprite sheet with all the original images.....be a pain tho. I dont know jack about ths sorta stuff coz its never come up for me (most stuff I do is local or a chrome extension which is local), but would async help with this? |
I spent some time poking around the code to find out what exactly about it is making it horrendously slow and I ended up finding this in jszip's documentation:
Source: http://stuk.github.io/jszip/documentation/limitations.html Seems like using jszip is likely to create performance issues even on the most capable browsers. I'm going to side with @PAEz and recommend you use application cache. I'm using it in an app (http://wholesale.mizbeach.com) with a much higher memory footprint than yours, as well as a very big library (React.js) and I'm experiencing no problems whatsoever performance wise. For all intents and purposes, my app should be much slower than yours, but it's leaps and bounds faster simple because I package the app in appcache and you're using jszip. |
@Akamaozu Thanks for looking into this for us. I'm not intimately familiar with the application cache, but my understanding was that it was for storing data. How exactly does it help with memory intensive operations? You write to the cache instead of a variable? I'd love to see an example, or pull request ;) Also, are we sure that the unzipping is really causing a bottleneck? I would assume that waiting for the network data (especially when it is being fetched serially) is orders of magnitude slower than even very complicated/slow computation. Here is a screenshot of the network profile from Chrome. On this airport wifi, it's taking about 2.25 seconds to fetch all the assets. Notice how My computer may be faster than others. Do we have any profiling data to really show that jszip is causing a significant bottleneck for some users? |
The reason I mentioned the application cache is for the above. The unzipping shouldnt be much of a pain for this file because its rather small....unless, as I stated before, your on a slow computer/device and then it really could be. Akamaozu's advice to use an uncompressed zip is right. When a zip is uncompressed it is piss easy to decompress and involves no maths as its just header crap and block locations. If you convert all the images to png and rezip with no compression its actually a smaller file (85k compared to 98k) and worked fine (no bitching in the console, in Chrome anywayz). Here's one for you to try.... OH, and if your thinking of using the app cache then read this... |
Didn't find any simple way to pre-cache the skin file, and we now have a loading state (0bb44e7), I'm closing this. |
Since we now require a javascript library, and we don't start requesting the skin asset until all the javascript has been downloaded, it can sometimes take quite a while before Winamp actually renders. I would like to see a few things happen to improve that experience.
#winamp
div some kind of content or default state that indicates that work is being done. Maybe the Windows hourglass cursor in the center? This state will be disabled once the skin is applied.The text was updated successfully, but these errors were encountered: