Tuesday, 15 April 2014

How to improve the foreach perfomence In php -



How to improve the foreach perfomence In php -

i have 2 array

1) $pcinput_array have 3000 records 2) $compare_array have 3.5 lax records (depends upon requirement increasing)

foreach($compare_array $key => $val){ $brutgers = convertresult($val['results'],$val['snp']); //this array have 96 records foreach($pcinput_array $inkey => $inval){ $arutgers = convertresult($inval['results'],$inval['snp']); //this array have 96 records $result_array = array_intersect_assoc($arutger,$brutger); $total = count($result_array); if($totalmatched >= $this->allotherrutgersmatch) { $status = true; } if($status) { $result['status'] = '0'; $pass[] = $val['ruid']; } else { $fail[] = $val['ruid']; } } } public function convertresult($value,$key) { $values = str_split($value); $keys = explode(',',$key); //$results = $this->safearraycombine($keys, $values); $results = array_combine($keys,$values); homecoming $results; }

while run coding php server freezing , taking 3 4 hour. need improve performance. how improve performance. please help me. have struggle lastly 2 week.

thanks, sivanesan.v

php

No comments:

Post a Comment