Jump to content
Wandering Soulstar

Execution Efficency

Recommended Posts

Hi All,

Have a question to see if anyone knows or has looked into the following to see what is more efficient. Scenario is that I am going to be setting the LinkParams of a number of prims (5-10). Would it be better to make all the calls with one single llSetLinkPrimitiveParamsFast using multiple PRIM_TARGET to do in a single call, or do a loop calling llSetLinkPrimitiveParamsFast once for each prim?

Share this post


Link to post
Share on other sites

My question to you is: Do these prims HAVE to change appearance at the same time?

Scripts on SL can be interrupted (or rather ignored) during any given "frame" of processing time. If you have multiple calls, other scripts might (and they will) be prioritized over yours, leaving only the first few prims with new appearances until the rest of the script gets to run. If you only have one call, even though it can be delayed, it will affect all prims at the same time.

Personally, if my intent was "simultaneous change," I would use one big call. I think there is no significant difference in memory usage, and the code can be neatly formatted on multiple lines. One call might be faster as well, but I have no proof.

Edited by Wulfie Reanimator

Share this post


Link to post
Share on other sites

Like Wulfie, I have to evidence to suggest that one method is more efficient than the other.  My default choice is to put all related SLPP commands into a single statement, but only because it's more efficient for me personally.  I can see the flow of execution more clearly in my own mind when I can write more compact code.  But that may just be me.

  • Like 1

Share this post


Link to post
Share on other sites

However... for the sake of theatre it might be worth having the blinds change sequentially, either in a logical sequence around the room or randomly.

Seriously, if you can add drama to the mundane you are enhancing people's experience of SL.

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

Thanks All ... in the end there was too much additional code for this to work right independent of one large or multiple calls ... will in the end leave it as each blind moving one after the other.

  • Like 1

Share this post


Link to post
Share on other sites

from a code efficiency pov, where execution time is the meaning of efficiency, then as Rolig mentions less API calls is more efficient than more API calls

from a added effects pov then is as KT mentions. The meaning of efficiency changes. What is the most efficient way to ,make multiple API calls to create the desired effect 

Share this post


Link to post
Share on other sites

People tend not to operate their blinds all that often. You're never going to generate much system load that way.

Script load comes from stuff that's running on a timer at a high rate when the object is not being used by an avatar. It's important to turn off your timers when they are not needed. Or at least slow them way down. Vehicles should turn off when parked. Active stuff should turn off until triggered by a collision or an infrequent sensor poll. Breedables, farming, etc - timers should fire maybe once a minute or two when no one is interacting with them.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...