Some questions
#1

How can I see what part of code is not good optimized? There is a program for that?

When I compile i will receive:
HTML Code:
Header size:          27380 bytes
Code size:          4960456 bytes
Data size:         27034968 bytes
Stack/heap size:     180000 bytes; estimated max. usage=11835 cells (47340 bytes)
Total requirements:32202804 bytes
That values are ok?

What is header size / stack/heap size and requirements?
Reply
#2

Check your last added script. If you have been adding un-optimized code to your gamemode frequently, well, then... good luck.
Reply
#3

Quote:
Originally Posted by Unte99
View Post
Check your last added script. If you have been adding un-optimized code to your gamemode frequently, well, then... good luck.
I asked you how can I see what part of code is not optmized, i don't wanna check the last code. I want to check the entire script !
Reply
#4

I don't think it's happening because your code is not optimized, but you can fix it by adding #pragma dynamic. I had to add this recently as well, because some functions stopped working such as print.

EDIT: I'm probably wrong at this point.
Reply
#5

Quote:
Originally Posted by Nin9r
View Post
I asked you how can I see what part of code is not optmized, i don't wanna check the last code. I want to check the entire script !
Checking if a gamemode is optimized is not something that can be done in 1 minute. Okay, maybe it can, because the compiler already is showing you that something is wrong in your code and is causing memory problems. But there isn't a program that could open your gamemode, read it and fix everything for you.

https://sampforum.blast.hk/showthread.php?tid=569978

Quote:

Warnings should never be silenced - they should be fixed the correct way!

Reply
#6

Quote:
Originally Posted by Unte99
View Post
Checking if a gamemode is optimized is not something that can be done in 1 minute. Okay, maybe it can, because the compiler already is showing you that something is wrong in your code and is causing memory problems. But there isn't a program that could open your gamemode, read it and fix everything for you.

https://sampforum.blast.hk/showthread.php?tid=569978
a. I found #pragma tabsize 0 in my GM. So, do I have to remove it or set on 4 value (default) and fix the warnings?

b. About #pragma dynamic (??) what do I have to put after dynamic, number of lines code or?
I add #pragma dynamic 92000 and now i receive on compile
"
HTML Code:
Header size:          27384 bytes
Code size:          4975472 bytes
Data size:         79471744 bytes
Stack/heap size:     499488 bytes; estimated max. usage=11835 cells (47340 bytes)
Total requirements:84974088 bytes
"
c. What's the maximum values in compile warnings to be sure that is solved? What do I have to check/? Requirements or size of header?
Reply
#7

Quote:
Originally Posted by Nin9r
View Post
a. I found #pragma tabsize 0 in my GM. So, do I have to remove it or set on 4 value (default) and fix the warnings?

b. About #pragma dynamic (??) what do I have to put after dynamic, number of lines code or?

c. What's the maximum values in compile warnings to be sure that is solved? What do I have to check/? Requirements or size of header?
1) Tabsize has nothing to do with your warnings. Tabsize is for indentation and you are having memory warnings.

2) You will not solve your problem by using #pragma dynamic. You will just make the warnings not show. Your gamemode will still have memory problems. If you DO use #pragma dynamic you will just hide the warnings and forget about the problem that will always stay with the gamemode. I was just showing that what GoldenLion said that using #pragma dynamic doesn't solve problems. And I pasted a quote from the link I gave you. Things like:

Code:
new text[1000];
new text2[1500];
make these warnings show up.

3) Don't know. You will have to search for this yourself.
Reply
#8

Depending on how much time you're willing to spend, consider benchmarking areas of your code, then rewriting parts (where you can), and benchmarking again. This is a very simple way of optimising your code (providing your getting better times on your second benchmark. However, if you find areas are causing issues, maybe it's taking to long to connect, you'd check OnPlayerConnect. However, it's a very time consuming task for what may feel like little reward, but once you've cleaned up your script, and all your benchmark results are coming back better and better you'll see a greater over all performance increase.
Reply
#9

Probably you have third debug turned on.
https://github.com/Zeex/samp-plugin-...ith-debug-info
Reply
#10

Quote:
Originally Posted by jlalt
View Post
Probably you have third debug turned on.
https://github.com/Zeex/samp-plugin-...ith-debug-info
I have -d3 in pawn.cfg. Do I have to remove it?

How can I see what part my script is using more memory?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)