Skip to content

Implement programmatic change detection profiler #3877

Closed

Description

@yjbanov

The profiler would be accessible via dev tools. When a developer installs the profiler DI module they get access to global functions they could invoke directly from the dev tools console.

The profiler would be exposed under global namespace ng (which in the future could host more tools). To profile change detection specifically, a developer would enter:

ng.profileChangeDetection();

The profiler would invoke LifeCycle.tick() at least 5 times and for at least 500ms. It will then compute the average and the standard deviation of amount of time it took to execute a single tick.

profileChangeDetection takes an optional named boolean parameter record that's false by default. When set to true, it records the profile as a CPU profile that could be inspected later in the "Profiles" tab of the dev tools:

ng.profileChangeDetection({ record: true });

In the future, we may add more options as named parameters, such as custom number of tick runs or custom length of profile.

/cc @vsavkin, @mhevery

Activity

  1. self-assigned this
    on Aug 27, 2015
  2. 0x-r4bbit commented on Aug 30, 2015

    @0x-r4bbit
    Contributor

    I love this. Same APIs could be used to make a decent browser extension out of it (or extending Batarang)

  3. mhevery commented on Aug 31, 2015

    @mhevery
    Contributor

    @yjbanov Sounds good to me. Please use ng as the global object as it will be consistent with ng.probe etc...

  4. gkalpak commented on Sep 9, 2015

    @gkalpak
    Member

    @yjbanov, shouldn't this have been closed by 8dd6c46 ?

  5. yjbanov commented on Sep 9, 2015

    @yjbanov
    ContributorAuthor
  6. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions