airfranceklm / ng-lazy-image

Angular directive for loading responsive image when container (which is preventing reflow) is in viewport.
http://afklm.github.io/ng-lazy-image/
MIT License
350 stars 64 forks source link

Browser back slowness #43

Closed mmccallum closed 8 years ago

mmccallum commented 8 years ago

Seem to be experiencing some slowness when using the browsers back button. It seems that lazy-image is doing a destroy that takes a very long time. When I have 40 lazy load images (placed using an ng-repeat) on the page, it can take up to 20 seconds after clicking the back button for the previous page to display.

Is there a preferred method of handling a browser back click that might be faster? I assume the slowness is due to the DOM manipulation.

Thanks! M

SquadraCorse commented 8 years ago

ng-route or ui-router? Heap snapshots don't show strange things in our testcases, the only "heavy" part is the scroll and resize binder per image container in first time but should not take that much time in rendering. Are you sure your route is destroying old view?

In chrome, run timeline record your session then see which function in your stack are troublesome.

mmccallum commented 8 years ago

ng-route.

Strange, when I use timeline, there is no slowness at all. It goes back to the previous page with no delay whatsoever.

Actually, I just tried it again with the developer console closed at there also is no slowness. I guess there is no issue here. Sorry.

-M

On Sun, Jan 3, 2016 at 8:57 PM, SquadraCorse notifications@github.com wrote:

ng-route or ui-router? Heap snapshots don't show strange things. Are you sure your route is destroying old view? In chrome, run timeline record your session then see which function in your stack are troublesome.

— Reply to this email directly or view it on GitHub https://github.com/afklm/ng-lazy-image/issues/43#issuecomment-168564901.

SquadraCorse commented 8 years ago

No worries, next time create simply snapshots then you know where the cullprit is. Also easier to see if between both states stuff is leaking or not (memory usage is also a good indicator). Good luck!