本文介绍了在PHP- MySQL或MySQLi中哪个最快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人对这种二分法有任何第一手的经验.一些博客说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之间的性能差异相形见war.与选择MySQL扩展相比,使用mod_php或FastCGI,APC之类的字节码缓存或明智地使用数据缓存来减少数据库命中,对PHP脚本的整体性能要有利得多.

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中哪个最快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 23:54