欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

MySQL和PDO测试对比

程序员文章站 2022-05-25 09:33:26
...

说明
time 发生时间
class 类别
case 测试用例名称
step 用例被执行次数
runtime 总的测试时间
memory(peak) 消耗的最大内存

连接

time:2010-07-01 10:53:40, class:pdo, case:connect, step:100000, runtime:21.52, memory(peak): 262144
time:2010-07-01 10:54:08, class:mysql, case:connect, step:100000, runtime:4.42, memory(peak): 262144

结论:从连接上看PDO的效率会低一些。


插入

time:2010-07-01 10:37:55, class:pdo, case:insert, step:100000, runtime:7.96, memory(peak): 262144
time:2010-07-01 10:38:03, class:mysql, case:insert, step:100000, runtime:7.93, memory(peak): 262144

结论:两者差不多

查询

time:2010-07-01 11:06:41, class:pdo, case:select, step:100000, runtime:10.48, memory(peak): 262144
time:2010-07-01 11:06:54, class:mysql, case:select, step:100000, runtime:10.07, memory(peak): 262144