performance - PHP $_POST vs saving data in an array -


this question has answer here:

this not bug or issue. while reading lot of performance realated articles came know how javascript variables take more resources load , better put global variable javascript local variable work - specially in loops.

so wondering if such thing happens on $_post php. in give me performance improvement if have lot of post data. save in local array $post_data = $_post;

and reference in required.

not worth time. $_post array in memory, no need duplicate it.

to size of $_post in bytes, can this:

strlen(serialize($_post)); 

(serialize turn object string can saved , unserialized. )


fwiw in for loops, if don't cache length of array , instead use this...

for(var = 0; < myarray.length; i++) {} 

...js have recalculate .length each time starts iteration, it's expensive, particularly on big arrays.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -