Speeding up asset load times

Speeding up asset load times
0.0 0



I’m trying to speed up asset load times by not putting all assets in resource.js but using cc.Loader.preloadAsync to load additional assets after the game has started.

This seems to work, but I’m not sure if I’m seeing any large decrease in load times.

Is this likely to help???



        var res = [





        cc.Loader.preloadAsync(res, this.preloadComplete, this);


My CCLoader.js doesn’t even have a preloadAsync function…

This could explain why it’s not doing much for you :slight_smile:

Check the console, is it getting an error?



Hi Farmer Joe

The version I downloaded from GitHub last week seems to have that function on line 432


I’m not sure when preloadAsync was added, but it doesnt give any errors and it appears to work, i.e I appear to be able omit resources from the initial preload (ie not put in them in resource.js)

I’ll need to double check, but I thought if I don’t preload, then assets are not available in the main part of a game etc


Ah yeah my bad, the loader class is actually a lot different, and works a lot better!

As for the async loading, it appeared to work as intended for me.

As far as assets not being available if you don’t preload them, I don’t think that is the case, they would just be loaded at the point of use. I’m not positive on that one though.


It supports multi scene resources preloading now.

Please take a look on /Sample/tests or /Samples/games/MoonWarriors.


@Shun Lin

Thanks. I’ll download the new version and take a look at the changes




you can slice up your resource list to only load what is required for the scene to function

this will speed up loading time on launch