optimize php script process to limit memory usage of array
$30-250 USD
货到付款
Preprocessing
Order input in sets PG, SG, SF, PF, C by ratio in decrement order.
Remove players in each array with ratio < X.
Remove players in each array with value < Y.
Batching
For batching the process we have to send back to the client the index of each array in this way
So from the server to client will travel two different information:
1. Feed back for the human user
2. Internal status for processing next batch (not showed to human user)
In client JavaScript code will be executing:
1. It calls the PHP script using AJAX (only the tab with the lineups is refreshed)
2. When script ends processing chunk (100k for example), shows info to the human user. For example: “100k of 1000M combinations processed…” and show results so far
3. If we are not done, call the PHP again using AJAX again, but we pass batch status a a POST parameter in the equest
项目ID: #7404928