Login - Create Account
Bookmark and Share

Optimizing Filters for Speed

Login or Register to post new topics or replies
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Quote
uberzev wrote:
Anybody know which are the "heaviest" components?


1. SLOWEST: Image-based components (Blur, Motion Blur, Sharpen and High Pass) with any slow component (like Worley-based noise) as a source.

2. SLOW: Worley-based noises (any Noise except Perlin, which is very fast).

3. SLOW: Image-based components (see above) in general, because they need to prepare a source bitmap before rendering themselves.

4. CAN BE SLOW: Refraction, especially with a slow component as a source. Refraction takes 3 samples of the source input.

5. CAN BE SLOW: 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.

6. CAN BE SLOW: 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).

5. 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.

6. FAST: Patterns, Channels, Adjustments, Gradients (except for Noise gradient).

7. ULTRA-FAST: Externals (Image and Selection), Checker, Switch, Blend, Offset.
  Details E-Mail
rilos
rilos
Posts: 71
Filters: 1
Thats a good hint, thanks a lot!

regards, rilos
  Details E-Mail
byRo
an Englishman in Brazil

Posts: 138
Filters: 8
Quote
Vladimir Golovin wrote:
7. ULTRA-FAST: Externals (Image and Selection), Checker, Switch, Blend, Offset.

Sometimes a filter may use the External Image as an input to many different components. Often the connections can cross the whole filter from start to end.

In this "ULTRA-FAST" case, can I interpret that we can sprinkle duplicates of the External Image throughout the filter without suffering any (or too much) delay. i.e. increased legibility, without sacrificing speed. smile;)

If so, is the same true of the other components quoted?


_________________________________
My favourite question is "Why?".
My second favourite is "Why not?"
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Quote
byRo wrote:
In this "ULTRA-FAST" case, can I interpret that we can sprinkle duplicates of the External Image throughout the filter without suffering any (or too much) delay


Yes, you can use multiple duplicates of the Image component, this won't affect the speed.
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Quote
Vladimir Golovin wrote:
If so, is the same true of the other components quoted?


External > Selection.

As for other components, I would not recommend duplicating them. The renderer has an optimization called "sample cache" that can save you a significant amount of rendering time in situations when a single component has multiple outbound connections -- you won't get the speedup when using duplicates instead of connections.
  Details E-Mail
byRo
an Englishman in Brazil

Posts: 138
Filters: 8
Thank you, Vladimir.

_________________________________
My favourite question is "Why?".
My second favourite is "Why not?"
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4037
Filters: 59
Maybe these optimization tips should also go into the help wiki (I couldn't find them in the wiki anywhere). And how about a rendering knowledge-base with its own sub-section?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Torley
Second Lifer

Posts: 303
Good tips to keep in mind! Thanx. smile:D
I'm enjoying using Filter Forge to create http://torley.com/textures
  Details E-Mail
StevieJ
Designer/Artist

Posts: 11224
Filters: 163
Great info!!! Thanx Vladimir smile:)
Steve

"Buzzards gotta eat...same as worms..." - Clint :)
  Details E-Mail
uberzev
not uberfez

Posts: 1821
Filters: 36
Quote
Vladimir Golovin wrote:
Refraction takes 3 samples of the source input.
Can you elaborate on this?
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
A sample is a single evaluation of the image function (built by the filter tree) at given coordinates. To determine the surface normal vector, we need to know the surface heights of at least two more points near the location of the central sample. Hence, three samples.
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4037
Filters: 59
Vladimir,

the average user probably won't be too familiar with the technicalities of sample-based architectures (and neither am I). Although there already is good info on this in the 'Result Component' Wiki entry, I sincerely hope to see a section that delves deeper into the topics of 'rendering', 'samples', the 'image function' and the 'filter tree', sort of a 'Filter Forge under the hood' article. smile:D
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Some info can be found here:
http://www.filterforge.com/more/help/...nents.html
  Details E-Mail
David S

Posts: 99
Filters: 19
Obviously one would want to create the most efficient filter possible, so the User does not have to "wait for the paint to dry", but at times efficiency and creativity seem to be at the opposite ends of the spectrum. How long is too long, when it comes to rendering, for a filter to be accepted in the library?
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Quote
David Scheffert wrote:
How long is too long, when it comes to rendering, for a filter to be accepted in the library?


We usually don't reject filters based on their rendering time, except for filters with absurdly long rendering time which blocks our rendering queue. You can look at the filters included with Filter Forge to get the idea of acceptable rendering time.
  Details E-Mail
StevieJ
Designer/Artist

Posts: 11224
Filters: 163
Carl had one rejected because of it.....I think it took 7 or 8 minutes to render.....
Steve

"Buzzards gotta eat...same as worms..." - Clint :)
  Details E-Mail
divi
Posts: 4
Filters: 3
does extracting channels improve performance aswell? let's say you have a b/w noise and extract the lightness-channel and continue to perform whatever it is with that channel only - will this improve performance compared to using just the noiseoutput or is this approach useless because an empty hue and saturation channel dont cost performance anyway?

cheers
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1344
Filters: 38
Quote
divi wrote:
does extracting channels improve performance aswell? let's say you have a b/w noise and extract the lightness-channel and continue to perform whatever it is with that channel only - will this improve performance compared to using just the noiseoutput or is this approach useless because an empty hue and saturation channel dont cost performance anyway?


No, you will simply be processing R = G = B after that. However if you have different grayscale sources that will be processed exactly the same way, you can assemble them into a composite source (e.g. Assemble RGB), do your processing and extract the channels when needed seperately. That might speed up things a little.
Njyldgarkn sample cache!
  Details E-Mail
Carl
c r v a

Posts: 7139
Filters: 74
Vlad is there a speed list for the new components, or can you update your first post - I seem to have taken a backward step with speed of V2 filters smile:)
  Details E-Mail
Vladimir Golovin
Administrator
Filter Forge, Inc.
Posts: 3106
Filters: 54
Sure, I'll update the post after the release. For now, here's the quick info:

- Everything in the RGB Math category is very fast. Derivative is a bit slower due to two samples per incoming sample.

- All Transforms are very fast.

- Polygon, Ellipse and Rectangle (and their Free counterparts) are generally fast.

- Free Gradient is very fast, but the Relative Repeat continuation mode slows things down a bit.

- Both Bombers are fast, but watch the Density parameter, larger values can slow things down.

- Median/Minimum/Maximum can be slow on high Radius valyes, plus they're bitmap-based.

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

- HDRness doesn't make components slow, so new HDRized components should be as fast as their LDR counterparts and older versions.
  Details E-Mail
Carl
c r v a

Posts: 7139
Filters: 74
Thanks, that's a help, the Median/Minimum/Maximum is my problem I think then smile:)
  Details E-Mail
smoocherz
Posts: 6
Hello Vladimir, I have been a Filter Forge user for some time now and have created many wonderful images with its help. However the "Speed" issue is a major concern to me. Might I suggest that you either create a new category based on speed or simply add a rating to each filter with a 1 - 10 scale so people like myself can avoid the ones that are just too time consuming.

I have a Dell Precision T3400 with an Intel Core2 Duo CPU E4500 @ 2.20 Ghz, # GB Ram, 32 Bit Operating System, NVidia 8500 GT Video Card.

I am open to getting a new PC that will be more effective and faster if y0ou can suggest any for a reasonable price.

Thank You for your time.

Regards,
David Kessler
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1344
Filters: 38
Quote
smoocherz wrote:
a new category based on speed or simply add a rating to each filter with a 1 - 10 scale


That is an excellent idea!

I have a few comments/ideas for that.

First of all, since rendering now takes place clientside, we have many different systems, so the rating should be normalized somehow.

For that I suggest either a benchmark of the system that can be used as normalization factor, or a test rendering of a specific default filter that is used to measure the performance on a given system. This could be done the first time FF is installed or when the first filter is submitted.

When a filter is submitted and the preset rendering starts, an average tile rendering time is calculated. This average time is normalized with system bench value from earlier.

This should ensure a consistent measurement smile:)
Njyldgarkn sample cache!
  Details E-Mail
inujima

Posts: 107
Filters: 20
I had been thinking that I could raise filter speed by making component composition simpler. but it was a misunderstanding.

Image
In the above example, outputs of A and B are same results.
However, rendering time is greatly different.
Rendering time of A is 13.01 seconds, but B is 1.48 seconds.
I thought that the function of the offset component caches the value of a result temporarily, and if it would be called with same arguments at next time , the cached value is returned.
But...

Image
In this example, rendering time of C is 4.30 seconds and D is 27.52 seconds.
Perhaps, in this case, the function of C is called seven times by calling one time the function of D.
However, like assumption of the previous example, if the function of the offset component has a cache, numbers of times of calling the function of C should be two.
I have not understood well about this structure. smile:?:

Image
One more example.
In this example, added multiblend component which is same as C in the last example, and they are connected to each offset components.
Although this looks inefficient, the rendering time of E is 9.31 seconds.
It is 3 times faster than previous example.

Method of Increasing a speed of filters seems so complicated more than I had thought. smile:|
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Very interesting inujima. thanks
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Inujima, in the first example, what the heck makes B so much faster than A? smile:?:
If anything I would imagine ading another component would SLOW everything down a bit, not make it almost 9 times FASTER smile:!:
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Quote
Inujima wrote:

Method of Increasing a speed of filters seems so complicated more than I had thought.


I know another way that it could help to increase the speed of filters, and this is that the FF developers team can make a new better and more optimized render engine for FF 4.0 and so all is supossed that would be faster. HINT HINT smile:D smile:D Do you listen FF Inc.?
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Probably not smile:evil:
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1344
Filters: 38
Looks like the sample cache mechanism is broken - I bet thats what the new 3.007 release is about.

Btw here is an informative discussion on the sample cache stuff..
Njyldgarkn sample cache!
  Details E-Mail
inujima

Posts: 107
Filters: 20
Quote
Morgantao wrote:

Inujima, in the first example, what the heck makes B so much faster than A?


The reason is that sample cache is working in B but is not working in A.
All the components may have sample cache function as Vladimir wrote at above link, but it is working only in limited situation.
The sample cache mechanism may be broken as Sphinx said, otherwise the system might have been changed. smile:?:
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Quote
Sphinx wrote:

I bet thats what the new 3.007 release is about.


Regretably this has NOT been included in the 3.007 update, so we will have to wait until another update.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 6210
Filters: 12
Quote
David S wrote:

Obviously one would want to create the most efficient filter possible, so the User does not have to "wait for the paint to dry", but at times efficiency and creativity seem to be at the opposite ends of the spectrum. How long is too long, when it comes to rendering ?


Good question, as how long is too long for waiting for a filter to render the result so the User does not have to "wait for the paint to dry" and I agree that we want to make the most efficient filter possible but for creative and innovative filters are many times complex and with lots of components, so it depends on the FF render engine speed to process all of them to offer the final result.

Again with the question, How long is too long for you ? How much can you wait for a result you want and need ?
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Yep, there's no magic number on how long is too long. It totaly depends on the user and how much he wants the result a filter gives.
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

15,377 Registered Users
+6 new last day!

112,622 Posts
+90 new in 7 days!

10,102 Topics
+16 new in 7 days!

Online Users Last 15 minutes:

13 unregistered users.

Recent Wiki Edits:

Follow filterforge on Twitter