YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

Terrifyingly slow & server crash

Open samp-pinch opened this issue 6 years ago • 9 comments

I noticed something, YSI 5 is starting pretty slow unlike 4.x... Its not the main problem, main problem is that when player connects to the server and YSI is not initialised yet, server "crashes", any function like SCM, SetPlayerCameraPos isn't working, when player enters his account password it just appears again i think its due to bad password cuz i cannot see cuz SCM isn't working... I cannot stop player from connecting cuz i added var and set it on true when main() executes and if false to close the connection but no success :( Btw initialising takes quite a while because colandreas is taking its time too...

samp-pinch avatar Jan 30 '19 15:01 samp-pinch

This may shed some light on the situation: https://forum.sa-mp.com/showthread.php?t=663302&highlight=YSI+slow

Southclaws avatar Jan 30 '19 15:01 Southclaws

My Scavenge and Survive gamemode used to have a 5 minute startup sometimes and never had any issues, I'd just place players into a queue and await the server to finish initialising before allowing them to do anything.

Southclaws avatar Jan 30 '19 15:01 Southclaws

How? I made gvar which is false until main is executed and its not working... RPC?

samp-pinch avatar Jan 30 '19 15:01 samp-pinch

I have one avenue of recourse left to me on this issue, one I didn't want to go down because it is complicated (or I assumed so, reading the algorithm documentation, maybe not so much) - Knuth-Morris-Pratt. I'll hopefully get that done this weekend and vastly improve the search times. There is even another algorithm - Rabin-Karp, which is well suited to searching a lot of needles in a single haystack at once, and thus may be better for use in codescan.

Y-Less avatar Jan 30 '19 17:01 Y-Less

So i cannot understand well anyone in the thread, how to speed it up? One more question: Is there any speed dif btw 4x Y_INI and 5x Y_INI cuz i use only y_ini

samp-pinch avatar Jan 31 '19 21:01 samp-pinch

Unless you can improve codescan, you can't speed it up. And yes there is probably a difference in y_ini, but I'm not sure what it is. I know the 5.x code is simpler, shorter, and covers more cases

Y-Less avatar Jan 31 '19 21:01 Y-Less

I do not know what "improvments" 5x have, but I suppose its the best for you go back on 4x and start all over again with 5x... I know its your work and I do not know how much time and effort you guys spent there, but fixing 5x is wasted time... 4x vs 5x server boot time: 5x - 25.32s 4x - 7.32s Its 18s longer man...

samp-pinch avatar Jan 31 '19 21:01 samp-pinch

The improvements are that far more stuff is done initially. 4.x creates inline functions lazily when they are first encountered for example, 5.x looks for them ahead of time. This increases start-up times, but makes running code faster. But most importantly, this method works with the JIT plugin, which 4.x can't.

Y-Less avatar Jan 31 '19 22:01 Y-Less

And as I say, I have an idea of how to make this searching faster.

Y-Less avatar Jan 31 '19 22:01 Y-Less