Faster pwn compiler
#1

is they any faster pwn compiler because mine seems to take time just to compile if so can you link me anything that makes it compile to AMX faster without messing any coding up.
Reply
#2

https://sampwiki.blast.hk/wiki/Scripting_Editors

I don't know wich one is faster though.
Reply
#3

To compile faster, you need a better PC. There is no other way.
All the editors use the same compiler.
Reply
#4

Yup, pawncc is only choice you have. I'll attempt to write one based on LLVM, but not in the nearest future. https://github.com/Zeex/pawn/ - you can rewrite pawncc better if you know how.
Reply
#5

I doubt you can, since this compiler is adapted for SA-MP.
Reply
#6

Quote:
Originally Posted by davve95
View Post
https://sampwiki.blast.hk/wiki/Scripting_Editors

I don't know wich one is faster though.
Those editors are just that - editors. They aren't different compilers. They all use pawncc.exe.
Reply
#7

CPU and RAM speed will directly affect the compiler speed.
The best cheap way to speed it up still is to optimize the script, or to optimize the frequency of compiling. Unless you got no idea what youre doing you dont neccessarily need to compile the gamemode every new line. With some plans and attention you can also write several hundred lines without compiling it, and without the risk to add compiler crash bugs that take hours to fix.
Alternatively, just use the compiling time and continue working on the script (you might need to use another editor as not all editors run the compiler in background). The compiler just reads the script once, so theres no problem with saving it once the compiler is running (afaik). However, this kind of scripting can be nasty at some points, especially when youre already in some completely different part of the code when the compiler tells you theres a problem in the part your wrote 15 minutes ago. So in order to use the time effectively you should be able to focus on multiple parts of the script at once. Then youre not losing any time to the slow compiler.
Reply
#8

You can try the compiler which Misur has linked to, it runs a bit faster than the official SA-MP compiler. For example, compiling Los Angeles Roleplay took for me about 20% less time in release mode (with -d0) and about 60% in debug mode (-d3).
Reply
#9

Quote:
Originally Posted by Mauzen
View Post
CPU and RAM speed will directly affect the compiler speed.
The best cheap way to speed it up still is to optimize the script, or to optimize the frequency of compiling. Unless you got no idea what youre doing you dont neccessarily need to compile the gamemode every new line. With some plans and attention you can also write several hundred lines without compiling it, and without the risk to add compiler crash bugs that take hours to fix.
Alternatively, just use the compiling time and continue working on the script (you might need to use another editor as not all editors run the compiler in background). The compiler just reads the script once, so theres no problem with saving it once the compiler is running (afaik). However, this kind of scripting can be nasty at some points, especially when youre already in some completely different part of the code when the compiler tells you theres a problem in the part your wrote 15 minutes ago. So in order to use the time effectively you should be able to focus on multiple parts of the script at once. Then youre not losing any time to the slow compiler.
Good idea but let's say they was tons of mapping codes inside a filerscript tons of lines that would compile faster then the gamemode just saying anyways no idea why Djson makes the compiler slow including dini etc, i think it all depends on how neat, you keep the script from not having alot of lines and pointless things such as // and /* \* and i have never had a crash bug with a compiler yet guessing that's due to the { or } anything really thanks for your great long message about it really useful.


Quote:
Originally Posted by MP2
View Post
Those editors are just that - editors. They aren't different compilers. They all use pawncc.exe.
i have not seen one without using the pawncc.exe


Quote:
Originally Posted by davve95
View Post
https://sampwiki.blast.hk/wiki/Scripting_Editors

I don't know wich one is faster though.
Well wiki tells me to keep my script neat.

i might follow that wiki on my next project.


Quote:
Originally Posted by Misiur
View Post
Yup, pawncc is only choice you have. I'll attempt to write one based on LLVM, but not in the nearest future. https://github.com/Zeex/pawn/ - you can rewrite pawncc better if you know how.
A friend of mine goes to college to do something like that not pretty sure maybe he can help me out if he understands pwn scripting.
Reply
#10

Well the obvious thing to say based on what you said is don't put your maps in the script - put them in a .map file or something and include a map loader. That way you make the script vastly smaller and don't need to re-compile just to change your mapping, just change and re-load the map file.

Of course, the real question is HOW long does it take? Anything around a minute, you could just go make a cup of tea while waiting. Things mentioned like reducing lines (especially comments) are terrible ideas as they make your code less readable and will not make a noticeable difference to compile times (comments are about the fastest thing to compile, because they do nothing).
Reply
#11

There is not way to compile your pawn file faster than your current time unless you buys a new computer with better ram, try using less \'Functions\' and use \'OnPlayerUpdate\' . . .
Reply
#12

Quote:
Originally Posted by dali123
View Post
There is not way to compile your pawn file faster than your current time unless you buys a new computer with better ram, try using less \'Functions\' and use \'OnPlayerUpdate\' . . .
bought a new computer, compiling much faster, thanks!!
Reply
#13

Since this has already been bumped, I would like to add an advice to improve slightly the compilation time: remove from your script all the things that can be loaded at runtime, such as the DynamicObjects.

For example if you have a block of code that looks like this
Code:
CreateDynamicObject(214, 2140.024, 2140.02, 242.22, 4.42, 340.3, 34.0);
CreateDynamicObject(214, 2140.024, 2140.02, 242.22, 4.42, 340.3, 34.0);
CreateDynamicObject(214, 2140.024, 2140.02, 242.22, 4.42, 340.3, 34.0);
[...]
You can simply move all these lines to an external text file, remove "CreateDynamicObject(" and ");" with Find+Replace and load the file using fread and sscanf.
Code:
while(fread(file, line))
{
    if(sscanf(line, "iffffff", model, x, y, z, rx, ry, rz))
        continue;
    CreateDynamicObject(model, x, y, z, rx, ry, rz);
}
Reply
#14

Also huge switch case statements bring alot of compile-time:
Code:
	switch (somevar)
	{
		case 0 .. 4999:
		{
			// Do something
		}
		case 5000 .. 9999:
		{
			// Do something
		}
		case 10000 .. 14999:
		{
			// Do something
		}
	}
This code in a blank script will lead to huge compile times already.

It\'s not only the length of the script that matters, it\'s also the way it\'s written.

Code:
if (0 <= somevar <= 4999)
	// Do something
if (5000 <= somevar <= 9999)
	// Do something
if (10000 <= somevar <= 14999)
	// Do something
Changing it to this does the exact same thing, but will make compile time alot faster again.


The huge switch statement made the compiler generate a separate if-statement for every value, so it was in fact creating 15000 if-statements.

Not to mention that would generate a massive AMX file as well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)