Do you happen to have functions that read all rows of a database result into one array, without processing the rows, and pass the array to other functions? For example, do you fetch results in your database class and pass them to a template engine displaying? If so, here is excellent news for you. mysqli_fetch_all(), which comes with mysqlnd, does the task of fetching the data sometimes twice as fast as mysqli_fetch_array(). Reason being: it saves a loop with function calls…
mixed mysqli_fetch_all( mysqli_result $result [, int $resulttype] )
The new API call, which is only available if you build
ext/mysqli with mysqlnd support, does fetch all rows of a
result set into an array with just one function call:
$all_rows = mysqli_fetch_all($res);
The one mysqli_fetch_all() call does exactly the same as the following loop:
…[Read more]