Faster pwn compiler
#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


Messages In This Thread
Faster pwn compiler - by Yves - 01.03.2014, 11:22
Re: Faster pwn compiler - by davve95 - 01.03.2014, 11:33
Re: Faster pwn compiler - by im - 01.03.2014, 12:27
Re: Faster pwn compiler - by Misiur - 01.03.2014, 12:43
Re: Faster pwn compiler - by Jochemd - 01.03.2014, 13:17
Re: Faster pwn compiler - by MP2 - 01.03.2014, 13:44
Re: Faster pwn compiler - by Mauzen - 01.03.2014, 13:47
Re: Faster pwn compiler - by xeeZ - 01.03.2014, 14:07
Re: Faster pwn compiler - by Yves - 01.03.2014, 20:05
Re: Faster pwn compiler - by ColeMiner - 02.03.2014, 14:56
Re: Faster pwn compiler - by dali123 - 26.05.2018, 22:24
Re: Faster pwn compiler - by cuber - 27.05.2018, 01:06
Re: Faster pwn compiler - by Sasino97 - 01.06.2018, 12:20
Re: Faster pwn compiler - by AmigaBlizzard - 08.06.2018, 18:21

Forum Jump:


Users browsing this thread: 2 Guest(s)