开发者

Is it true that at times it may be more beneficial NOT to call mysqli_result::free, mysqli_result::close, mysqli_result::free_result

开发者 https://www.devze.com 2023-03-22 09:35 出处:网络
Is it true that at times it may be more beneficial NOT to call mysqli_result::free, mysqli_result::clo开发者_JAVA技巧se, mysqli_result::free_result especially when the page itself is short and since p

Is it true that at times it may be more beneficial NOT to call mysqli_result::free, mysqli_result::clo开发者_JAVA技巧se, mysqli_result::free_result especially when the page itself is short and since php will automatically free the resources once the page itself has finished processing?


Either you do it or PHP does that for you, I don't see a difference, you wont gain anything. But it is bad to get a habit of omitting free, and close functions just because it is done for you automatically. One day you might forget to do it inside a loop where it matters.


I will said : FALSE. Especially if you do alot of simple queries, having nested queries everywhere in your database abstraction and in the same time want a very efficient (in performance terms) apps. Do some benchmarking, and its result will speak the truth.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号