Memory vs CPU:Is it worth trying to optimize scripts for memory at the cost of efficiency?
#1

Memory vs CPU
Is it worth trying to optimize scripts for memory at the cost of efficiency?

How much memory does a SA-MP server take?
On average my server takes around 150MB.In the worst case, it would go up to 200MB.I don't think if there is any server (working) which takes up more than half a gig.This amount in today's world is actually negligible.

How much memory does your server take?(Reply so that I can carry out a census)

Is it worth saving memory?
Of course, it is good to save memory whenever possible.But is it worth saving memory at the cost of efficiency?
  • BitArrays take more time than simple assignments (bool variables)
  • Packed Strings - takes time packing and unpacking strings
The only reasonable reason which I can think of to save memory is to reduce heap/stack size.

What is your opinion?
Both memory as well as Speed is important according to me but I would avoid optimizing for memory if it takes a small cut on the efficiency.I think we need to pay more attention towards optimizing scripts for speed rather than optimizing for memory.That doesn't mean that you can waste lot of memory.
Reply
#2

Actually.. I don't care about amx-size or memory use.
I always care about efficiency.

I have --- efficiency > memory
Reply
#3

Currently running at ~44MB. I'd say 1MB per player. Memory may be a bit of a problem on low end VPS' with 256MB of RAM or less, but should run fine on anything 512MB and up. In any case: premature optimization is evil.

(I also find it quite ironic that a company that calls themselves 'ramnode' provides so little RAM.)
Reply
#4

Quote:
Originally Posted by Vince
View Post
(I also find it quite ironic that a company that calls themselves 'ramnode' provides so little RAM.)
They provide up to 8192MB (? so-little), if you need more you can always contact Nick_A on LowEndTalk forums.
Reply
#5

Use Vectoral Pawn plugin by rancho.
Reply
#6

Quote:
Originally Posted by codectile
View Post
Use Vectoral Pawn plugin by rancho.
I have actually already made my own plugin which has algorithms(STL + frequently used functions) + lists + vectors + ...

I made it in 2014 and never published.It has only features which I use so it is incomplete and that's one reason why I never published it.Also this is one reason why I cannot publish the include which I make(all of them use it :/ ).I have lot of amazing includes :/

Releasing this involves lot of work, I can't release half done scripts :P
Maybe in future I would release it!

Quote:

/************************************************** ************************************************** ***********************
STL for PAWN
<algorithm>

Mainly a collection of functions which are designed to operate on STL Containers

Version:1.3.2 (22/5/2015) - Added common config file - stl_config.inc
1.3.2: Added qsort,bsort and many other algorithms
1.3.1: Bug Fix
1.3:New Functions
1.2:90% of STL Algorithms added
1.1:Added Player Algorithms
1.0:First Release

Refer stl_algobase_log.txt for detailed information

Copyright © 2014 Yashas Samaga

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
************************************************** ************************************************** ***********************/

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)