I have about 300 strings (coords like this: x:y:z) in an array (or JSON?). Should I save the array (cache or whatever it is called) or calculate it every time I execute the function? Does saving it in an array cosume more RAM or memory? I am not so sure so...
Why not test both instead of asking? Use http://php.net/manual/en/function.microtime.php to see how long it takes. Use http://php.net/manual/en/function.memory-get-usage.php to see memory usage. No doubt there are more functions to see what is better. Test Test Test!