SpaceRay
![]() |
I am sorry that I knew before what the Sample Cache was, but now I think I forgot what it is so please, can you be so kind to explain how it works with FF components?
I know that the Sample Cache is very important and can speed up sometimes a filter as it was told in the new FF 7.0 I want to optimize filters to have the best possible speed and so I could consider using some components that are faster over others slower, or not use some components if it is really not needed THIS IS WHAT I HAVE SEEN IN THE FORUM
Correct me if it is wrong, So then, does it mean that is much better to use (if possible) multiple times the same component with output to different components, than repeat this component for each of the components that would need it, although it may be more complex than this Wondering what components get cached
Thanks very much for any possible help |
|||||||||||||
Posted: March 8, 2020 2:59 pm | ||||||||||||||
Sphinx.
![]() |
Caching: Ask the same question again, and you get a copy of the previous answer
![]() You're helping a friend (the result component). Your friend asks "What color is there at x = 1 and y = 1?". You don't know (you're the "Invert" type), but you know someone that knows someone (the component sub tree) and ask your sources. You have to wait though, because one of them is busy and another is just plain lazy.. but at some point you get an answer: "Red". You tell your friend "Cyan". Now comes along another friend and ask you the same question: What color is there at x = 1 and y = 1?". You answer "Cyan" immediately, because you remembered. Now the old sample cache could only remember one result, and would use that if the next question was about the same x and y values. If the next question was about different x or y values, it would ask its subtree, do its own thing and store that result for eventual reuse when asked about the same thing again. The old result from first question would simply get discarded (and if someone asked that original question again, it would have to recalculate the answer). The new sample cache (V7 +) writes down the coordinates along with the answer, so even if asked different and reccuring questions in "random" order, old answers will be reused if the question matches. Makes sense? You write the following:
Well, given the explanation above: in pre V7 FF it would not be as simple as that, because distorters (Offset, Noise distortion etc) changes the x and y coordinates down the subtree. So with multiple connections with multiple x and y "questions", you'd end up reducing the chance for a hit or simply wasting the cached answers. In V7+ I'd say "YES - Reuse as much as possible". I am curious though if the sample cache layer is always present, or the design is smarter and FF deduces when sample cache is needed (all those "if" checks stack up and becomes a performance matter alone). Vlad? |
|||||||||||||
Posted: March 9, 2020 4:12 am | ||||||||||||||
Skybase
![]() |
Honest thought about this: You don't need to get super technical. It only matters because the discussion (to me) is interesting or that there's a specific behavior I'm looking for in a construction. Either way, the sample caching system is technically something more so behind-the-scenes and it honestly shouldn't be something that bothers you on the surface. It ultimately boils down to what you want to make. If it works, it works. I tend to not even deal with it in my filters at all. Additionally the ultimate tip when it comes to "fast filters" is just use less nodes. |
|||||||||||||
Posted: March 9, 2020 5:31 am | ||||||||||||||
GMM
Moderator
Posts: 3491 |
I presume there is a separate check whether it is faster to access the cache or calculate the sample from scratch. At the moment I can't consult with the programmer who implemented the latest cache architecture. I could ask other developers to look into the code but only if you are very, very curious ![]() |
|||||||||||||
Posted: March 10, 2020 6:26 am | ||||||||||||||
Sphinx.
![]() |
Nooo no no, that would mean even less time for fixing the script init situation ![]() ![]() |
|||||||||||||
Posted: March 10, 2020 10:04 am | ||||||||||||||
SpaceRay
![]() |
Thanks very much for taking the time and for the well done and detailed explanation and I did understand it right. Great
Like how you explained it and how it has changed in FF 7 and is helpful and useful
Thanks for answering , Yes, I agree that maybe is not very important to be aware and put much atention on this cache, and just only ,as you say, if it works right and good is ok, and if not try to find a different way, and what is good is to try to use less nodes possible to get what you want |
|||||||||||||
Posted: March 27, 2020 2:21 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,534 Posts
+31 new in 30 days!
15,348 Topics
+72 new in year!
8 unregistered users.