Skip to main content

Dependency performance

Issue summary

A dependency performance issue occurs when resolving a component takes too long due to its complexity and the number of dependencies it retrieves.

Because the time to resolve depends on how many dependencies must be retrieved, the thresholds scale with dependency graph complexity:

  • Target: 5 ms × number of dependencies
  • Tolerance: up to 20 ms × number of dependencies

Why it matters

When a dependency has too many sub-dependencies or takes longer than expected per resolution call, it can delay multiple components relying on it, causing widespread slowdowns and degrading app responsiveness.

These issues often originate from overall graph complexity, not just individual slow dependencies, making detection and root cause analysis challenging without proper tools.

Severity calculation

SeverityDefinition
No issue raisedTotal resolution time ≤ (5 ms × number of dependencies). Performance is within expected limits.
Low–MediumTotal resolution time exceeds target but is within tolerance (between 5 ms × dependencies and 20 ms × dependencies). Moderate performance impact.
High–CriticalTotal resolution time exceeds tolerance (> 20 ms × number of dependencies). Maximum severity indicating serious performance bottleneck.

How to fix a dependency performance issue

When Kotzilla detects a dependency performance issue, your focus should be on analyzing the entire dependency graph of the component to identify bottlenecks both in the parent and its child dependencies.

💡 Note: Individual slow dependencies are flagged separately as Child Dependency Performance Issues. This parent-level issue is triggered only if the total resolution time of the component (including all its dependencies) exceeds the threshold based on its complexity.

Focus on:

  • Simplifying the dependency graph to reduce complexity
  • Optimizing slow individual dependencies
  • Leveraging lazy loading and background resolution where possible
  1. Simplify and optimize the dependency graph
    Break down large or complex components into smaller, focused modules. Avoid deep or tightly coupled dependency chains that increase resolution time. Aim to isolate heavy or optional dependencies so they can be loaded only when necessary. Reducing overall graph complexity improves resolution speed across your app and prevents cascading slowdowns.

  2. Identify and optimize slow dependencies
    Profile individual dependencies to pinpoint those causing delays. Optimize these by improving data handling (e.g., caching), offloading expensive operations to background threads, or refactoring to reduce complexity. Prioritizing optimization on slow dependencies has a high impact on overall app responsiveness.

Use the Kotzilla SDK API and the Console to investigate

The Kotzilla Console provides detailed views of dependency resolution times, highlighting which components and their sub-dependencies cause slowdowns. You can drill into the complexity of the dependency graph and the resolution duration for each component on every recorded user session using the Kotzilla Timeline view.

By instrumenting your code with the Kotzilla SDK API, you can trace and profile component initializations, helping you pinpoint inefficient dependencies or problematic graph structures.

For full setup and usage details, check the Kotzilla SDK API documentation.

Need help?

Struggling with dependency resolution performance? Our experts are ready to help. Reach out anytime for tailored advice and best practices!