Skip to main content

What are Pure and Impure Pipes and how do they affect performance?

Junior Angular
Quick Answer Pure pipes: run only when input reference changes (default). Angular caches the result - same input = same output = no recomputation. Impure pipes: run on every change detection cycle regardless of input changes. Impure pipes are expensive and should be avoided for frequently rendering components. Use impure pipes only when necessary (e.g., async pipe which must track subscriptions).

Answer

Pure Pipes: Run only when input changes, fast and cached.

Impure Pipes: Run on every change detection cycle, can slow performance.

Impure pipes are needed only when data mutates without reference change.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice