Morgantao
![]() |
Can someone please explain this to me?
I have a filter that takes 30 seconds on avarage to render an image. Let's call it Romancing the Gorrilla by Carl. ![]() I take the resulting image and feed it as input to a socond filter, that takes around 1 second to render. Let's call this filter M_Shadows and Highlights by Morgantao ![]() That took a total 31 seconds of render time, right? So how it is that if I take the second filter AS IS and put it at the very end of the first filter, it takes 2 minutes and 43 seconds to render the exact same image?? ![]() I even added a switch so I can just turn my filter on/off inside of Carl's filter, and I get the exact same results... When the switch is set to pass through my filter, it takes alsmost 3 minutes, and with the switch set to bypass my filter it takes only 30 seconds. ![]() What gives?! ![]() Carl, is it ok with you if I upload the combined filter here? |
|||
Posted: April 17, 2012 3:07 pm | ||||
Nebukadnezar |
Is there some kind of cache-component?
The difference is perhaps that in one case the source is a bitmap. What happens if you plug a small blur between the two filters? (For testing.) I read somewhere blur is one of the few components that renders a bitmap. |
|||
Posted: April 17, 2012 3:21 pm | ||||
SpaceRay
![]() |
I have tried it myself and have put your filter after the Switch component and is true that it is much slower after this
![]() ![]() ![]() There something fishy in this mix of filters as this can´t be possible |
|||
Posted: April 17, 2012 3:30 pm | ||||
Morgantao
![]() |
I added the blur as you suggested, and it takes the render time down a little, but it's still waaaay slower than the original filters...
If it is indeed a caching issue, I think it's time that FF inc. either solve the issue, or at least add a bitmapping component, kind of a result node that has an output (SpaceRay, sounds familliar?). |
|||
Posted: April 17, 2012 3:35 pm | ||||
Nebukadnezar |
I think there might be something like "too much" precision.
The Filter Forge algorithm seems to perform very poorly with long filter chains. One reason might be to safe RAM, but there are times when it would clearly benefit from simply rendering each step in the chain and passing it on further down, instead of doing whatever it does. (Which has probably its advantages, too.) Try linking several edge detection components and witness your system come to a grinding halt. Try running the same number of those edge detection components in parallel and it's no problem at all. For many cases that extra precision is not needed at all and there should be the possibility to switch to a more stupid/less precise/forward algorithm. I imagine something like this happens: A point of the last component needs 4 points of the second last component to be calculated. Each of those 4 points needs 4 points of the third last component to be calculated Each of those 4 points needs 4 points of the fourth last component to be calculated. And so on. Exponential growth, rendering frenzy, grinding halt. While with a forward approach (with caching/setting back the precision after each step) the rendering time would increase more linearly. Each time it's the "same" four points that are used to render the next step, instead of a ever growing/finer mesh. Both ways have their advantages so either the program or the filter author should be able to decide which way to go. (I basically don't know what I'm talking about so bear with me ![]() Thinking about it, if the information about each pixel/point in each step is kept and the resolution stays the same down the chain there should be no difference. But even more RAM would be needed than building a cache for each step and flushing the older ones down the toilet. (Ok, you could render buckets either way like FF seems to do.) But if you get finer and finer the deeper you go... |
|||
Posted: April 17, 2012 8:18 pm | ||||
SpaceRay
![]() |
I want to put here how I have mixed both filters from the first post and do not know if this is the best way to do it or there could be a better alternative to mix them.
The Switch is the very last component of Carl´s filter before the result component, so I changed the result for Morgantao´s filter. I have reduced the way Morgantao have arranged the filter so it can fit everything in the screen and can make a screenshot that is big to see it well. ![]() |
|||
Posted: April 17, 2012 11:34 pm | ||||
SpaceRay
![]() |
Nebukadnezar thanks for the theory and suggestion, well done
Good explained, fr om all of you have said I have a question Does this mean that if FF could have more RAM would be faster and do not need to economy RAM ? ______________________________________________________ Could the Morgantao´s filter be put in another place than the end of Carl´s filter and this way would be faster ? Although really I do not wh ere to put it because from the construction of Carl´s filter I think that you can´t put it before the last switch component |
|||
Posted: April 17, 2012 11:36 pm | ||||
Morgantao
![]() |
SpaceRay, while this is an interesting qeustion, does it really matter?
We both know that one of the main problems with FF is the custom memory manager, and we both know there's no plans of updating the 6 year old manager with something better. As have been said on another thread, the FF inc. has programed itself into a corner. What they did may have been ground breaking 6 years ago, but it lacks the ability to evolve and be adapted to newer hardware. What FF needs now is nothing less than a complete overhaul. It should be rebuilt from the ground up, with lessons learned from the past. FF inc's official response to this was: No way! Too much work. |
|||
Posted: April 18, 2012 4:02 am | ||||
Sphinx.
![]() |
While Nebukadnezars observation about sample branching is a very important aspect to focus on regarding performance, I don't think that is the problem in this actual case:
The memory usage vs FF allocation restrictions seem to cause the bitmap buffers to get flushed (in blur, sharpen etc). I'm not sure about the details here. If this is correct, you should see a significant performance improvement at some point if you reduce the input image size (try e.g. 256x256 and see if the same strange performance penalties show up). That is also why the blur buffer trick won't work (actually it will just use more mem.) - the reason you see a slightly increase in speed is most likely related to the anti alias process getting simplified by that blur.. |
|||
Posted: April 18, 2012 4:34 am | ||||
Nebukadnezar |
That's the nicest way anyone ever told me I was wrong.
![]() |
|||
Posted: April 18, 2012 12:25 pm | ||||
SpaceRay
![]() |
Thanks Sphinx for the answer but I am sorry to say that I really do not have the enough knowledge about FF to understand your answer.
Morgantao, very well said, and totally agree with what you have put in your last post. It would be really nice to have the opinion or any suggestion from FF inc. itself as they know really best how FF works and WHY this is happening and if there could be a good way to solve this if possible. |
|||
Posted: April 19, 2012 2:48 am | ||||
Sphinx.
![]() |
Ok, the essence is that the memory restriction is the likely culprit. You can verify this claim by testing with lower resolution images: at some given lower size I predict that the strange additional overhead disappears
![]() |
|||
Posted: April 19, 2012 2:53 am | ||||
Morgantao
![]() |
Well, I just tried testing with a 100x100 image, and pure gorilla takes around 8 seconds.
With my addition it's close to 40 seconds. Do you still think it's just a memory thing? Maybe there's anything else you could think of? ![]() |
|||
Posted: April 22, 2012 1:33 pm | ||||
SpaceRay
![]() |
This is really strange, as you have confirmed that at a very low resolution of 100x100 keeps THE SAME speed so, the problems seems not to be what Sphinx suggested well, and there is another thing that we are missing and is happening and we do not see it.
Why the mix of this components give this much slower result ? ![]() ![]() ![]() ![]() |
|||
Posted: April 22, 2012 10:32 pm | ||||
SpaceRay
![]() |
As the good Sphinx RAM theory could have been possible it seems that as Morgantao have showed it is not true, so does anybody else have another suggestion about WHY this is happening ?
We should call Sherlock Holmes to solve this mistery ? ![]() ![]() |
|||
Posted: April 29, 2012 12:22 am | ||||
SpaceRay
![]() |
Has been discovered the hidden mystery behind this ?
![]() Could this also happen with other mixes of filters or selected components and we do not know it unless we make a benchmark test like Morgantao have done ? |
|||
Posted: May 9, 2012 10:25 am | ||||
Morgantao
![]() |
I sure wish someone could test this out and see if he can find out what the problem is...
|
|||
Posted: May 9, 2012 2:32 pm | ||||
SpaceRay
![]() |
Perhaps you could contact the FF support and as ask to the experts at Filter Forge and see if they can give some light over this problem and why this happens.
It could be that it´s a UIB (Unidentified Invisible Bug) and then they could know about this and could perhaps find a fix. |
|||
Posted: May 9, 2012 10:27 pm | ||||
Morgantao
![]() |
OK, I will try this as soon as GMM informs us that the ticket system is back online
![]() |
|||
Posted: May 9, 2012 11:31 pm | ||||
SpaceRay
![]() |
OK
If this could be happening because of a bug inside FF no one would be able to help you other than the FF team. |
|||
Posted: May 9, 2012 11:38 pm | ||||
GMM
Moderator
Posts: 3491 |
I've already asked the developers to see into this. |
|||
Posted: May 10, 2012 3:29 am | ||||
Carl
![]() |
Just don't blame the poor endangered Gorrilla ![]() |
|||
Posted: May 10, 2012 5:08 am | ||||
Morgantao
![]() |
I think we should zap the gorilla with a cattle prod a few times to see if it makes it work faster
![]() |
|||
Posted: May 10, 2012 7:24 am | ||||
SpaceRay
![]() |
today is one month since the last news about this "problem", bug or whatever
Please, is there any NEW information about this ??? ![]()
As it has already gone one month since this, have they been able to test this and see why this is happening ? Thanks very much for your help |
|||
Posted: June 10, 2012 2:36 pm | ||||
SpaceRay
![]() |
I think this would interesting to be able to optimize filters more, because perhaps this is some kind of bug or unusual thing that happens only when combining certain components or mixing them and makes them very slow and could help to make them faster if it is discovered why this happens.
|
|||
Posted: June 11, 2012 1:52 am | ||||
Kraellin
![]() |
morgan, post up an example filter. easier to digest that way.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|||
Posted: June 11, 2012 12:55 pm | ||||
Morgantao
![]() |
OK, here it is...
First, look at the top post, and get the 2 filters. Test them individualy, and see how long things take to render on each of the filters. Then download the filter attached here, and test it. All it is, is Carl's gorilla filter, only with an option to have the result run through my shadow\highlight filter. If you check the "++" option, you use my filter too. If you uncheck "++", you use Carl's filter as is. Romancing the Gorrilla ++.ffxml |
|||
Posted: June 11, 2012 2:52 pm | ||||
SpaceRay
![]() |
Still no news about this, I think we will have to call Sherlock Forger to be able to solve it.
![]() |
|||
Posted: June 22, 2012 8:01 am | ||||
SpaceRay
![]() |
Anyone knows the phone or email of Sherlock Forger so he could investigate and know what is happening when you mix two filters and you may probably get unusually much higher render times?
I have seen that the same as it happens here, it can happen also with others combinations of filters that are good separate and when joined in one filter, the render time is much higher than the sum of the two. To be able to detect and investigate and know ourselves what could be happening, I think that perhaps one way could be to have the ability to know the render times of each component in the filter editor as suggested very well by Betis in this thread --> Workspace Rendering Times ![]() |
|||
Posted: February 6, 2013 4:57 pm | ||||
Vladimir Golovin
Administrator |
Nebukadnezar, you're completely correct regarding the exponential growth. This particular case is a side effect of FF's sample-based architecture: http://www.filterforge.com/more/help/...cture.html It has nothing to do with memory and caches since Edge Detector doesn't store any caches, it's a 100% sample-based component. Here's what happens: To evaluate a single output sample, the Edge Detector shoots multiple samples into their Source input. Let's say the number is 8, and let's assume the components are chained sequentially. The renderer requests a single sample from the first Edge Detector in the chain. The first Edge Detector begins to evaluate the color at requested sample coordinates and shoots 8 samples into its Source input. The second Edge Detector does the same (shoots 8 samples into its Source input), which repeats 8 times. Et cetera, et cetera. What you have here is essentially an exponential recursion which grows, roughly speaking, at O(8^n) where n is the number of Edge Detectors sequentially chained together. |
|||
Posted: February 7, 2013 4:52 am | ||||
Vladimir Golovin
Administrator |
Another possible source of slowdown with merged filter trees is the evaluation of image information beyond output image boundaries. Blur and Noise Distortion are two examples of components that require a larger "input area" than their output.
By passing the intermediate result as a saved bitmap, these beyond-the-border calculations are replaced by a crude bitmap mirroring / tiling trick (because there's no other way to obtain beyond-the-bounds information from a bitmap), and this trick is extremely fast. |
|||
Posted: February 7, 2013 5:17 am | ||||
SpaceRay
![]() |
Thanks very much for the answer Vladimir, will have to check and try this out.
Any possible suggestions and advice to avoid this great slow down when you mix components ? What you should take care and avoid to use combined? I mean what combination of possible components will make the mix make FF slow down and what alternative could there be more optimized? Thanks for any help |
|||
Posted: February 24, 2013 6:39 am | ||||
SpaceRay
![]() |
Please, anyone else is also having any possible misterious problems and the render time rises very much after combining fast components or mixing two filters?
|
|||
Posted: March 23, 2013 7:11 am | ||||
Sharandra
![]() |
Ray, there is an entire article on that topic in the Wiki. I suggest you go read that.
![]() |
|||
Posted: March 23, 2013 8:40 am | ||||
SpaceRay
![]() |
Sorry Sharandra that I did not know, please could you be so kind to tell me which article of the wiki are you refering to? Thanks |
|||
Posted: March 23, 2013 7:10 pm | ||||
Betis
![]() |
SpaceRay, Here's this Wiki Page and also this one.
Roses are #FF0000
Violets are #0000FF All my base are belong to you. |
|||
Posted: March 23, 2013 7:24 pm |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,711 Registered Users
+18 new in 30 days!
153,531 Posts
+39 new in 30 days!
15,347 Topics
+72 new in year!
21 unregistered users.