Jump to content

Some lag reduction question


Ayelin Ethaniel
 Share

You are about to reply to a thread that has been inactive for 4010 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Greetings fellows!

I'd like to avoid a lag problem in the future and i have two things in my mind:

1. solution: There is given 7 scripts. Each scripts has its own listener and dialog. Each scripts can call and communicate by each others via link message.

2. solution: Given 7 scripts, Each script has its own dialog, set to a channel by an other script. This script handles all of the dialog messages of the 7 scripts, and handling functions via link message in each scripts.

Each scripts has it's own functions, difference between two solution is removing listens and placing it into one script. this script will be a substitution of listen function and forwarding commands via linked message.

Which one cause more lag?

Link to comment
Share on other sites

I am created a pluginable script, with few plugins and the next owner can choose from them which one they want to use. An other problem, they have many functions that can't handle a simple script in 64kb. Recently the set is running with 0.02-0.04ms cpu usage and i know it can go downer. Same sets which i have by an other creator is running on 0.1-0.14ms that is a bit high for a simple item + the avatar.

Link to comment
Share on other sites

I'd suggest trying it both ways and seeing which wins.

My hunch is that it will be difficult to measure much of a consistent benefit either way. If I had to make an argument in favor of the multiple listens it would be that only one script will run when a dialog response is received by its channel-specific listen, whereas link messages will wake up all the scripts with each response, all but one of which will immediately detect that the message is not for them. (That's assuming the scripts are all in the same prim so a link message can't be targeted to a specific script by its link address.)

  • Like 1
Link to comment
Share on other sites

if the listens are for dialogs - where is the problem? There is only one listen open and only if a dialog is in use. If the listens are always open your code is bad, so open the listen when needed and close after dialog is finished or timer runs out due to the timeout.

 

  • Like 1
Link to comment
Share on other sites

Thank you for all replies! It took a little time but i made a quick measure. Both items are running on ~0.011ms as idle, on active use around 0.03ms. Difference between them is the "calming time" when script usage is going back to normal. In this time it seems llListen in every scripts (for dialogs) is better than linked message solution. And yes i use timeout function :)
Thank you all! <3

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4010 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...