Jump to content
Search Community

Does clearing listeners from ImageLoaders optimise performance?

crooksy88 test
Moderator Tag

Recommended Posts

Hi,

 

If I load lots of ImageLoaders via a LoaderMax queue.

 

 

var queue = new LoaderMax({name:"mainQueue",onProgress:progressHandler,onComplete:completeHandler});

 

for(...) {

 

var _loader = new ImageLoader(_media_url+".jpg", {name:_media_url, container:this, width:100, height:100, scaleMode:"stretch", onComplete:completeHandler});

}

 

queue.append( _loader );

 

 

Is my code more efficient/optimised if I remove all listeners from all ImageLoaders or does it not make any difference if I just leave them there?

 

I had an idea of creating a new bitmap of the loaded content and then using dispose(true) for all the ImageLoaders. Would that be more efficient than just keeping the ImageLoaders as they are?

 

Thanks,

 

Mark

Link to comment
Share on other sites

I suppose that would be a bit more efficient, but I really doubt you'd notice much difference. It isn't as though LoaderMax is a memory hog. And your listeners will only fire when they're necessary, so if you've got onComplete listeners in place, it isn't as though they keep draining CPU cycles after you've loaded your file(s). But yes, it's always a good practice to clean up after yourself.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...