YOUR ACCOUNT

Login or Register to post new topics or replies
rilos
rilos
Posts: 88
Filters: 9
Hi all,

not sure if it wasnt posted here already but I had the idea of creating a filter compiler instead of an interpreter (which i guess is used today for rendering) to speed up the render process up to 100 or 1000 times!

Am I right with my assumption, that during processing time the filter is interpreted instead of beeing compiled to fast machine code first?

This could be a revolution in speed!

cheers,
rilos
regards, rilos
  Details E-Mail
Betis
The Blacksmith

Posts: 1207
Filters: 76
Could be a large change in architecture, probably not as bad as GPU rendering, but I think it's worth looking into!
Roses are #FF0000
Violets are #0000FF
All my base are belong to you.
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
rilos

Am I right with my assumption, that during processing time the filter is interpreted instead of beeing compiled to fast machine code first?

This could be a revolution in speed!


As far as I know the filter forge render engine works only interpreting the filter and does not make any kind of conversion, just only follow the instructions given by the filter.

I do not know how is programmed filter forge and how it is done, and what language is using, but I think that this idea of converting the filter to machine code first could probably work and would be true maybe that would be much faster, but I do not that this is the only thing and would be just this, and to be done, (although I do not know) it would probably need to change also more things in the FF render engine to be able to do it.

Quote
Betis

Could be a large change in architecture, probably not as bad as GPU rendering, but I think it's worth looking into!


YES! if this really could be possible and doable in some possible way, would be a good alternative to GPU if it works and the results would be faster, and also think that would be worth looking into and see if with FF could be faster, as it would really be a very good thing and something really great and would rise much the usability of FF.

We already know that the FF team is not going to make a GPU based FF, so perhaps this alternative could be a good idea if possible, although this must be confirmed by Vladimir or someone from the FF team.
  Details E-Mail
rilos
rilos
Posts: 88
Filters: 9
Would be interesting to hear what the officials say to that suggestion...?

I recognized that when staart rendering to file, FF needs some time to start - so that could be some kind of compilation - but I guess it doesnt compile the whole filter setup to machine or assembler code.

I guess that wouldnt be soo much an issue of architecture change - but it would be a very nice option for professional production on huge photos and textures - as it can take half and hour and much more to render.
regards, rilos
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
rilos

Would be interesting to hear what the officials say to that suggestion...?


Yes, I think it would be good if anyone from the filter forge team could say if this is a crazy or not possible idea, or could be something worth to look into and possible in some way and would help to make FF faster and better.

Quote
rilos

it would be a very nice option for professional production on huge photos and textures - as it can take half and hour and much more to render.


YES! It would be very good for higher resolutions, as I have made some 5000 x 5000 images and have taken between 45 to 60 minutes to render smile:( smile:cry: and was nearly the same with 6 different filters.
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
speed up the render process up to 100 or 1000 times! ... Am I right with my assumption, that during processing time the filter is interpreted instead of beeing compiled to fast machine code first?


Rilos, no, the assumption is incorrect. Let me explain the current architecture:

In FF code, each component has a method get_sample() which returns color (or curve height) at given coordinates, plus some extras (AAZones etc). The method is implemented in native C++ code, compiled by the MSVC compiler in Windows builds and GCC in Mac OS X builds. Both paths are optimized to the fullest extent possible and use as much compiler optimizations as we could safely turn on.

The only 'interpretation' that goes on at runtime (that is, rendering time) is when the get_sample() method is about to call the get_sample() of another component, it looks up the pointer to that component from a pre-built pointer cache which is populated before the rendering begins. The lookup is extremely fast, just a single dword/qword read from memory.

The takeaway is that the vast majority of the execution happens in heavily optimized native C++ code which doesn't involve interpretation from text or bytecode, so there's no interpretation to get rid of.
  Details E-Mail
rilos
rilos
Posts: 88
Filters: 9
Thanks for making that clear Vlad!

C++ can be compiled to very good and fast assembler code - so theres probably not much to optimize. It was just a guess - as I dont see any compilation time when editing a filter to render process. I recognized FF pauses a little before real rendering starts, so that could be the time the actual filter settings are compiled.

Maybe I am still wrong here and just the component-parts are precompiled but the actual node-construction is still interpreted at runtime - so that might be what you describe above when one component calls another it relies on...

I agree this cannot take too much time, but when it does this on each and every pixel this could sum up so some million procedure calls...
But probably there is no easy way to further optimize this...

Anyway FF got much faster now compared to version 1... smile;)
regards, rilos
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Thanks very much Vladimir for your answer here and explaining how Filter Forge is optimized and how it works, good to know
  Details E-Mail

Join Our Community!

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
+36 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

25 unregistered users.