Update of Magento stock quantity: reduced the memory footprint and improved performance by using read() instead of browse() and proceeding by steps of 1000 records at a time.