[Include] mBits - better than Booleans
#7

Hi,

So first off this is some pretty advanced stuff - rep+ for commanding a mastery of it MakuPL! I think you could probably improve on it in areas - specifically, you could eliminate your defines by bitshifting 1 left by setid (1 << setid) in your methods.

I agree with Pottus on the optimization front however. There are very few occasions where I personally would sacrifice CPU cycles for memory - so few that I can't even think of a scenario off the top of my head. Single threaded as SA-MP is; slow operations directly affect the playability of the server.

Memory, besides aesthetically being a large number (that is still a fraction of a fraction of a modern server's total RAM), is pretty much sidelined.

By its very nature this is many times slower than just directly setting or un-setting a variable - least of all because it has to set and return a new variable anyway.

As always I'd be happy to be proven wrong though.
Reply


Messages In This Thread
mBits - better than Booleans - by MakuPL - 04.02.2016, 17:01
Re: mBits - better than Booleans - by Yashas - 04.02.2016, 17:08
Re: mBits - better than Booleans - by Pottus - 04.02.2016, 17:13
Re: mBits - better than Booleans - by Slice - 04.02.2016, 17:45
Re: mBits - better than Booleans - by MakuPL - 04.02.2016, 19:01
Re: mBits - better than Booleans - by TakeiT - 04.02.2016, 20:50
Re: mBits - better than Booleans - by Alcatrik - 04.02.2016, 20:52
Re: mBits - better than Booleans - by Macluawn - 04.02.2016, 21:11
Re: mBits - better than Booleans - by AbyssMorgan - 05.02.2016, 05:52
Re: mBits - better than Booleans - by MakuPL - 05.02.2016, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)