Skip to content
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

Performance optimization #85

Open
rev087 opened this issue Apr 7, 2015 · 1 comment
Open

Performance optimization #85

rev087 opened this issue Apr 7, 2015 · 1 comment

Comments

@rev087
Copy link
Owner

rev087 commented Apr 7, 2015

ng-inspector currently runs very poorly on large apps, and this is mostly due to its naive approach to introspecting and detecting changes in the inspected Angular application.

Some profiling might be necessary to pinpoint the largest bottlenecks but it's safe to assume the biggest issue stem from the use of watchers, which the extension adds to every scope in the page.

Watchers are computationally expensive, and Angular best practices dictate that they should be used sparingly in an application. Due to the nature of a tool such as ng-inspector, this is not so simple.

One of the early ideas was to add and remove watchers based on wether the scope is collapsed or expanded in the UI. This approach has it's own issues, but an usability decision (based on user requests) was to open the ng-inspector panel with all scopes expanded, and objects/arrays collapsed. This undermines the benefits of toggling watchers based on the expanded/collapsed UI state.

Other ideas involve using watchers only on scopes that are currently visible in the extension's pane scroll viewport, along with their ancestors, but this approach introduces many complications - and in the end, depending on the structure of the scope tree might provide limited performance gains.

This is a complex issue, but nonetheless fundamental to the usefulness and usability of the extension, so ideas are very much appreciated!

@geeeeeeeeek
Copy link

@rev087 Any progress on that? Cuz it just stuck there when I was inspecting wx.qq.com, an extremely large Angular project. The page was not responding at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants