Page 1 of 1

Script optimalization, possible to auto delete unused vars?

Posted: Fri Dec 21, 2018 6:44 am
by Ciechu
Dear Friends,

Is there any solution (maybe ecompile function?) for automatic deletion unused vars (for now, when compile, it show only warnings)? It is true that unused vars with reference is harmful to performance?

Another question, in my console there is a status msg:

Image

What that's mean? How to read it? It will be very helpful.

Thank you,

I want to use this opportunity to wish you a Merry Christmas. :grouphug:

Re: Script optimalization, possible to auto delete unused vars?

Posted: Sun Dec 23, 2018 12:17 am
by ThisIsMe
In terms of unused variable names:
When it comes to escript, I can not tell you whether they are harmful.

When it comes to auto removing unused variable names, there is no way to currently remove them other than going through each script 1 by 1, little by little. Most people I imagine ignore the unused variable names warnings, they do not seem to cause much of an issue when it comes to execution.

What I would recommend is though, on a slow night when you don't feel like doing anything, just compile your shard, output to ecompile.log and just slowly go through and comment out or remove altogether unused variable names, it won't hurt and I have spent a lot of time doing it and just be disciplined enough, once you finalize something and compile it, if you get any unused variables you have no intention of using or referencing at a later point, to remove it then and there.

Sorry I could not be of more help.

Re: Script optimalization, possible to auto delete unused vars?

Posted: Sun Dec 23, 2018 1:09 am
by CWO
Sysload gives you the CPU usage and I believe the severity is in parentheses. The lower this number is the better.
cputime is how much processor time POL is using. The lower, the better.
scpt I believe is the number of script instances that are running.
task is how many tasks POL is running per minute. This is usually around 60. The number in parentheses is how many ran late.
scin is script instructions run in the last minute.
scsl not exactly sure what this is counting but it has to do with script sleep cycles
MOB is how many mobiles are currently in the world (both NPCs and PCs)
TLI is the number of top level items sitting in the world.

Re: Script optimalization, possible to auto delete unused vars?

Posted: Sun Dec 23, 2018 9:59 am
by Ciechu
Yay! Thank you very much for cooperation :)

Knowledge is power.

Re: Script optimalization, possible to auto delete unused vars?

Posted: Mon Dec 24, 2018 10:15 pm
by guialtran
an unused variable is not very harmful.
it is damaging proportionally to the amount of memory it expends, and the time the internal interpreter spends to create a variable
I tested it with my benchmark.
the numbers below mean the number of times the kernel can run in 1000 milliseconds
in 1 second an empty loop can be executed
1574096
1555249
1562784

in 1 second creating the variable "var a;"
1313730
1291503
1318031

in 1 second creating the variable "var a: = 100;"
1101233
1094029
1075924