Script optimalization, possible to auto delete unused vars?

Here you can post threads on the development of the current release of the core (100)

Moderator: POL Developer

Post Reply
User avatar
Ciechu
New User
Posts: 29
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Script optimalization, possible to auto delete unused vars?

Post by Ciechu » Fri Dec 21, 2018 6:44 am

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:
"Live Fast, Die Fast"
- GG Allin

ThisIsMe
Distro Developer
Posts: 76
Joined: Sun Jul 17, 2016 1:29 am
Contact:

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

Post by ThisIsMe » Sun Dec 23, 2018 12:17 am

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.

User avatar
CWO
POL Expert
Posts: 1148
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA
Contact:

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

Post by CWO » Sun Dec 23, 2018 1:09 am

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.

User avatar
Ciechu
New User
Posts: 29
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

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

Post by Ciechu » Sun Dec 23, 2018 9:59 am

Yay! Thank you very much for cooperation :)

Knowledge is power.
"Live Fast, Die Fast"
- GG Allin

guialtran
Grandmaster Poster
Posts: 117
Joined: Wed Jul 30, 2008 12:42 pm

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

Post by guialtran » Mon Dec 24, 2018 10:15 pm

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
Image Zulu Hotel Forgotten Realms
Imagewww.zuluhotel.com.br
Image Discord Cronos#8404

Post Reply