I have this feed with 10,000 records and a loop to obtain all that products and then create a product array using those columns.
That map is created differently for each retailer, so product name can be the name of the product or it can be two columns of the feed. Below is an example.
The problem i am facing is that each loop after do eval, eval, eval... it starts increasing madly the time. Even when there are no functions at all.
Eval is creating references ? functions ? temp vars ? its there a way to reset all of that ?
DEBUG TIME
[2014-05-14 10:21:08][DEBUG] Converted 500 products in 0.48338389396667 Memory usage: 247750752 Read / Total: 500 / 108640
(...)
[2014-05-14 10:26:06][DEBUG] Converted 500 products in 6.9182150363922 Memory usage: 247751288 Read / Total: 50000 / 108640
(...)
[2014-05-14 10:28:03][DEBUG] Converted 500 products in 7.5416939258575 Memory usage: 247749704 Read / Total: 60000 / 108640
EXAMPLE
For the Merchant A i am getting the product name with this php function:
array_explode(",",str_replace(" ","",$NAME))[0];
So my mapping $v will have a index "f" with the follow value:
array_explode(",",str_replace(" ","",$NAME))[0];
After i do the eval of that map
foreach($map as $k=>$v) {
(...)
$value = eval('return ' . $v["f"] . ";");
(...)
}
This works just fine i get all my product array just fine, but this is increasing maddly the execution time of my script. If i take that away the script runs fines with a 0.4secs per 500 lines / products.
I need the eval as i am using php code to parse / style the feed.
Help ? :)