Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$http should coalesce calls to $apply #5297

Closed
@kseamon

Description

@kseamon

Presently, $http calls $apply for every request response, even if they come in within milliseconds of each other. Using a short timeout (0ms, which in practice works out to 0-10ms) to $apply can reduce a lot of waste.

See example implementation here: https://github.com/kseamon/angular.js/compare/http-coalesce?expand=1

Using this code (Not ready for a pull request as it breaks tests and mocks, etc), I see the number of $apply calls in my app's startup drop from 40 to 16.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions