YOUR ACCOUNT

Login or Register to post new topics or replies
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Does anyone happen to know the overhead of using several script components to achieve something as opposed to scripting it all in one script?

What I mean, for example, is if I do one map script that controls color and another one that controls lightness, this seems to be much slower than doing one script that does both.

I haven't done any actual speed comparison between these, but I was hoping someone could tell me if there is a significant gain in putting all functions into one script component rather than spreading them out between two or more.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Thanks for the link Sphinx

Is this a possible answer to this question? So according this below would mean that one script would be better than many separated ones even if they are smaller and simpler.

Quote


Invert comparison
Compared to the build-in Filter Forge Invert, a script version takes four times as long to render, and this was with a very optimal script construction

Minimize no. of separate scripts

I started chaining build-in Inverts until I reached the same processing time as the single scripted Invert.. ~18 Inverts! This illustrates the low overhead of adding individual non-script components.

Repeating the actual invert code inside the script 18 times did not add much overhead though.

The conclusion here is that when you already entered the scripting context of a single script component, the script execution is pretty fast. Instead of introducing several separate script components (each with their function), try to stick to one and use functions etc to structure it.


ONLY USE SCRIPTS FOR WHAT CAN´T BE DONE WITH COMPONENTS

Quote
From the wiki link above
When you start to get hold of scripting in Filter Forge, you'll quickly notice that the time to code a simple script is often shorter than the time used to manually drag in components and do the setup.

However there is good reason not to do scripts for simple constructions: Speed!

By default the scripting functionality itself costs additional processing time, even though the script is as simple as it gets


So I think that if one script can be done with components instead of make it probably easier with the scripts for who knows how to do it, would be better to make it with components because it would be faster and also better to understand for others that do not have the skills and experience in scripting.

Scripting then will be useful when it would be not possible with the components or perhaps would be very complex to build with the components.
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Thanks Sphinx,

Exactly what I needed to know.

TD
  Details E-Mail

Join Our Community!

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,533 Posts
+31 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

112 unregistered users.