"Sims" <si*********@hotmail.com> wrote in message
news:c0*************@ID-162430.news.uni-berlin.de...
if it is in an include file, chances are the files is in cached in ram, and generaly speaking, the data is not a shared memory object, it can be one
memory object shared by all proccesses, but there is a good chance its
not.
to ease the load, in either case just put $100 in memory and call it a
day.
Thanks, but it is not a case of money, more a case of me wanting to learn
how it works.
If i can prevent the 'over' use of memory that would be better programming
i think.
It is a include file.
I just wanted to know the inner workings of php and how global variables
are affecting my memory.
BTW i do not use $, (NZ, CAN, US or AUS whichever you were referring to).
Regards,
Sims
sorry, I was not insuating it was a case of money, my apologies. (oh, and
the $=US, sorry, I forget this is read all over the world)
With scripting, it is a slightly differnt animal compared to
compiling/binary programming. some times in scripting it is the easyier
route that shall prevail.
Now I do undstand your curiosity.
It is possible with php to create a shared memory object (works like a file)
that would hold all items in your lang definitions, then this can be
available to all proccess.
But becouse we are dealing with more than just the PHP interpeter, such as
the OS, file system, I have found that included files that are used in every
single script (such as variable definitions/configs) tend to get cached by
the OS into memory, granted, they go from their cached copy to a new copy
for each process, it is rather fast. Also with less overhead on the
programming side of the fence. With the expense of a bit more memory, it
just be comes an include, but with it as as shared memory object, you then
have code to access such object, and a bit more complexity.
It is my opinion, that sometimes, an easier to read/modify script is a faste
r/econamical slotution. Now I am not advicating sloppy coding skills, In
fact, I come from a background where I would have to cram in an OS,
aplication, and data into a 2K ROM chip, not fun, but made for some crafy
coding (whitch I do miss sometimes)
Well, sorry to ramble on, I know I probly didn't answer your question, but I
hope I brought up some stuff to ponder.
--
Mike Bradley
http://www.gzentools.com -- free online php tools