Because this is a language problem, conventional solutions are more difficult to solve. The following is a scenario that is solved by string.
Copy CodeThe code is as follows:
$total = 100000;
$double = "";
for ($i = 0; $i < $total; $i + +)
{
$double. = Pack ("D", $i + 0.1);
}
for ($i = 0; $i < $total; $i + +)
{
Unpack ("@". ($i * 8). "/d", $double);
}
This example saves an array of double strings with a string. Then unpack out when it's in use.
Of course, this can affect performance. To see the specific needs.
For example, in this case:
You have 10 arrays, each of which is 10M (about 1 million data), then 10 takes 100M of memory.
Plus 10 people in parallel, the memory will be serious enough.
Then, in 10 arrays, not all are used at the same time. You can save them as a string
Then, when used, unpack a string into an array.
http://www.bkjia.com/PHPjc/321625.html www.bkjia.com true http://www.bkjia.com/PHPjc/321625.html techarticle because this is a language problem, conventional solutions are more difficult to solve. The following is a scenario that is solved by string. Copy the code code as follows: $total = 100000; $double = ""; for ($i = ...