Latency due to queued events

I posted a question a little earlier regarding trying to tell what objects are firing events, but my underlying problem with my web app is that a whole set of queued events causes significant latency. I have an app which loads quite a few images and those images seem to trigger Shown and PictureChanged events. These events keep cascaded well after the images are already visible on the page. In the case of the PictureChanged event at least, that’s not an event I have created but must just be firing from the framework behind the scenes. However, the events cause a huge amount of latency even in cases where it doesn’t seem the events are really doing anything or that a picture has actually changed. So I’m wondering if there’s a way to clear queued events or some other way to address the latency issue.

If you did not implement the event handler, it should not cause latency.

f you have implemented event handlers, a round trip can be around 200 milliseconds, so yes, that would cause a lot of delays. However, the mere loading of pictures is time consuming as well.

The best way to prevent undue latency due to event handlers is simply not to implement them.

For pictures, dragging them into the project is the worst offender, since for each picture a Webfile is created, and the app has to serve the image. Better store them in a web space and set the URL to point to it.