About "sleep cycles"

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

About "sleep cycles"

Post by xeon »

I searched documentation about this, can't find anything useful.

In script's profiling output, what's the meaning of "- XXX sleep cycles"? The script does too much sleep cycles?

For example:
Script scripts/test.ecl: 139559 instr cycles, -9236 sleep cycles, 150 seconds elapsed.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: About "sleep cycles"

Post by xeon »

up! :|
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: About "sleep cycles"

Post by xeon »

Uppete

Lately, POL staff seems pretty away from the project

:whip:
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Re: About "sleep cycles"

Post by Gnafu »

It's quite difficult to say if you have too much sleep cycles or not.
I think 6% it's ok for a tipical script.
If the script it's a critical one you should have no sleep cycles.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: About "sleep cycles"

Post by Turley »

Why should sleep cycles be something bad?
you get sleep cycles during wait_for_events and sleep*
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: About "sleep cycles"

Post by xeon »

Erm...
I just want to know the meaning of the "sleep cycles" value, how to interpret it and, in case is signaling something bad, which are the corrective measure to take.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: About "sleep cycles"

Post by Turley »

Its a simple counter. The executor runs through every active script and starts the instructions, if the script is inside a sleep it adds one to the counter.
The higher the counter is the more time the executor has for other scripts.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: About "sleep cycles"

Post by xeon »

Ok.
This is the meaning if "sleep cycles" is positive.

And if it is negative??
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: About "sleep cycles"

Post by Austin »

It means the number got too big and rolled over to negative
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: About "sleep cycles"

Post by xeon »

Uhmmm. Interesting.
Thank all for your response.

So, some sleepms() call less could fasten the script, without burdening POL, that's right?

Unfortunately the "togu escript performance guide" doesn't give advice on how to tune scripts.

I'm thinking about something like getting the script profile and checking if it is too heavy, than sleepms().
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: About "sleep cycles"

Post by Turley »

xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: About "sleep cycles"

Post by xeon »

As I read in the 096 doc

"the priority of a script is how many instructions it executes before switching to another script.
default script priority is 1. "

So, if I set the priority of my script to, for example, 20, it is more CPU-intensive than before, because in execute 20 instruction before being context-switched for another script.

Right?
Post Reply