X Tutup
Skip to content

Implement programmatic change detection profiler #3877

@yjbanov

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup