Skip to content

Performance issue with multiple concurrent uses of animationFrameScheduler #7017

Closed
@fdeslandes-wk

Description

@fdeslandes-wk

Describe the bug

Since version 7.5.0, there is a huge performance loss with animationFrameScheduler when there are a lot of timers emitting concurrently using the scheduler. The problem can be painfully obvious on slower machines and was found in our application using Angular CDK virtual scroll.

There was no such performance issue in version 7.4.0. The problem have probably been created by this code change

The performance issue is big enough to prevent the migration of our application to RxJs 7.5 + as it makes some parts of it near unusable.

Expected behavior

Independant observables using the animationFrameScheduler should not have a big performance impact on each others.

Reproduction code

See the Stackblitz code.

See the result in the console using rxJs 7.5.0 vs using rxJs 7.4.0. The result is dependant on your computer's performance, but should be quite obvious regardless

Reproduction URL

https://stackblitz.com/edit/rxjs-afsbug?file=package.json,index.ts

Version

7.5.0

Environment

No response

Additional context

Works properly and is a lot more performant before 7.5.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions