[Tutorial] Pack your strings NOW
#1

Recently I was searching in samp wiki and I found this
https://sampwiki.blast.hk/wiki/Strpack

I was like lets open it and see what it is then I found "Packed strings" I never knew about this before the good about it is once you pack the string it will use 75% less memory according to samp wiki so imagine the big scripts that uses many strings with 128,326 bytes etc...

An example you can take from samp wiki
Код:
new string[32 char];
strpack(string, "Hi, how are you?");
Later on I will update my thread with more information on how to pack your actual commands because now I need to experiment a bit with it :P sorry guys I know this isn't even a tutorial just thought I could share because not many people know about this.
Reply
#2

Good shit.
Reply
#3

Should've posted in Discussion forum. Anyway, I don't think it's worth the additional processing overhead unless I have a large array of strings. Also it's useless for any language that doesn't (exclusively) use the common Latin alphabet.
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=480529
Reply
#5

Unfortunately most functions from the standard Pawn libraries (also including user defined functions) and SA:MP natives are not compatible with packed strings.
Reply
#6

It's more for the USEFUL CODE
Reply
#7

Searching for it, it's been brought up before

Something like: http://forum.sa-mp.com/showpost.php?...21&postcount=7

Turns me off about it.

So it has some (Dis)advantages like every other thing.
Reply
#8

Bt memrosay is sе impotant rin 2k17 (

Good thought, but I'd rather write simpler code than saving something I don't have to save, then again maybe this becomes really important for someone who chooses to buy the cheapest VPS out there with slightly bad resources.
Reply
#9

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Bt memrosay is sе impotant rin 2k17 (

Good thought, but I'd rather write simpler code than saving something I don't have to save, then again maybe this becomes really important for someone who chooses to buy the cheapest VPS out there with slightly bad resources.
Didn't know 64mb RAM VPSes are still a thing xD
Reply
#10

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

But I still find it unnecessary, I'm ready to sacrifice few kb's for less headache whether my string is packed or not
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)