Optimizing Filters for Speed

From Filter Forge Wiki

Jump to: navigation, search

Contents

Components and Render Speed

Note: HDRness doesn't make components slow, so new HDRized components should be as fast as their LDR counterparts and older versions.

SLOWEST

  • Bitmap-based components (Blur, Motion Blur, Sharpen and High Pass) with any slow component (like Worley-based noise) as a source.

SLOW

  • Worley-based noises (any Noise except Perlin, which is very fast).
  • Bitmap-based components (see above) in general, because they need to prepare a source bitmap before rendering themselves.

CAN BE SLOW

  • Refraction (especially with a slow component as a source. Refraction takes 3 samples of the source input)
  • Median/Minimum/Maximum (can be slow on high Radius values, plus they're bitmap-based).
  • Any Noise (or any component based on Noise such as Noise Gradient, Noise Distortion or Noise Curve) with high Detail and Roughness (they are interdependent) especially with a custom curve as a profile.
  • Any Noise with a custom curve as a profile -- the curve is sampled once for each noise octave (for Details = 10 you have 10 samples of the curve per one noise sample).

CAN BE SLOW IN CERTAIN CASES

  • Any component that generates edges for anti-aliasing (Patterns, Worley noises, some of the adjustments). But since anti-aliasing is done in a separate pass, that shouldn't impact speed too much.

FAST

  • Adjustments
  • Bombers (watch the Density parameter, larger values can slow things down)
  • Channels
  • Derivative (a bit slower than the RGB Math components due to two samples per incoming sample)
  • Ellipse
  • Gradients (except for Noise gradient).
  • Patterns
  • Rectangle
  • Polygon

ULTRA-FAST

  • Blend
  • Checker
  • Externals
  • Free Gradient (Relative Repeat continuation mode slows things down a bit though)
  • RGB Math
  • Switch
  • Transforms

VARIABLE

  • Map Script & Curve Script. Speed depends on what you write there, obviously. Compared to native components, scripts are slower due to Lua interpretation/execution overhead.

Filter Tree

Duplicating Components

  • You can use multiple duplicates of the Image and Selection component, this won't affect rendering speed.
  • It is not recommended to duplicate other components. The renderer has an optimization called "sample cache" that can save a significant amount of rendering time in situations when a single component has multiple outbound connections. This speedup will not occur when using duplicates instead of connections.
  • If you have multiple outbound connections going to different distorters (e.g. Offset and Noise Distortion), which also have multiple outbound connections, try inserting a disabled Invert before each distorter branch. This can help preventing sample cache flushing.
Personal tools