問題描述
我想知道是否有人對這種二分法有任何第一手經驗.一些博客說mysql擴展比mysqli快.這是真的嗎?
I'd like to know if anyone has any first-hand experience with this dichotomy. A few blogs say the mysql extension is faster than mysqli. Is this true?
我只問速度.我知道 mysqli 具有舊擴展中不存在的功能.
And I'm only asking about speed. I know mysqli has features that are not present in the older extension.
推薦答案
在我所看到的大多數基準測試報告中,MySQL 擴展比 MySQLi 快得多.然而,差異是如此之小,以至于這可能不應該成為您在兩者之間做出決定的標準.
The MySQL extension is very slightly faster than MySQLi in most benchmarks I've seen reported. The difference is so slight, however, that this should probably not be your criterion for deciding between the two.
其他因素使 mysql 和 mysqli 之間的性能差異相形見絀.使用 mod_php 或 FastCGI,像 APC 這樣的字節碼緩存,或者明智地使用數據緩存來減少數據庫命中,對于 PHP 腳本的整體性能比選擇 MySQL 擴展更有益.
Other factors dwarf the difference in performance between mysql and mysqli. Using mod_php or FastCGI, a bytecode cache like APC, or using data caching judiciously to reduce database hits, are far more beneficial for overall performance of PHP scripts than the choice of MySQL extension.
不要吝嗇和愚蠢!:-)
Don't be penny wise and pound foolish! :-)
這篇關于PHP-MySQL 或 MySQLi 中哪個最快?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!