Awesome Reviewers

Reviewer · Performance Optimization

Cache expensive computations

Avoid repeating expensive work—object creation, function calls, or layout calculations—on every render, invocation, or interaction. Identify operations that produce the same result given the same inputs and compute them once, then cache or reuse the result instead of recalculating it each time.

Instruction

Avoid repeating expensive work—object creation, function calls, or layout calculations—on every render, invocation, or interaction. Identify operations that produce the same result given the same inputs and compute them once, then cache or reuse the result instead of recalculating it each time.

Examples of this pattern:

  • Creating a data view (or other heavyweight object) inside a component body means it gets recreated every time the component renders/opens. Instead, create it once during plugin setup (or memoize it with a stable key) and reuse the cached instance.
  • Calling the same pure function with identical inputs in multiple lifecycle methods (e.g., setup() and start()) wastes cycles. Compute it once and store it as a class property:
private readonly isEce = getIsEce({
  isCloudEnabled: this.isCloudEnabled,
  isServerlessEnabled: this.isServerlessEnabled,
  isSaasContainer: this.config.isSaasContainer,
});

// use `this.isEce` wherever needed instead of recomputing
  • Layout or rendering strategies that force expensive recalculation on every update (e.g., percentage-based table column widths causing slow reflow/selection) should be replaced with cheaper, fixed alternatives (e.g., pixel-based widths) when profiling shows a measurable slowdown.

Before merging, check for: objects/values created inside render paths or repeated across lifecycle hooks that don’t change per-call, and layout/sizing choices that trigger costly recalculation on interaction. Hoist or memoize such values, and prefer the cheaper computation strategy when both achieve the same visual/functional result.</description> </invoke>