perl模块net mysql,Perl模块:MySQL与DBI

A lot of our automated processes use perl and need to access our MySQL DBs. I hate to admit it, but up until recently we haven't really done much benchmarking with the majority of our processes. One of our devs setup a test to compare the performance of "use MySQL" vs "use DBI" with the following pseudocode:

for ($i = 1; $i <= 1000; $i++) {

pull and store all records in a 4,000 record table

}

Results:

MySQL - 57s, 56s, 57s

DBI - 43s, 42s, 43s

For some reason I was surprised to see DBI performing so much better; considering how little I know about either of the modules. I realize that there are likely several things wrong with the benchmark that was run and that everyone's setups/results are going to very but I was curious whether others have experienced any sort of performance gain by using DBI vs the MySQL module.

解决方案

I found the MySQL module he's referring to, it was part of the DBD::mysql dist. To quote it

As of Msql-Mysql-modules 1.19_10

M(y)sqlPerl is no longer a separate

module. Instead it is emulated using

the DBI drivers. You are strongly

encouraged to implement new code with

DBI directly.

So the emulation layer is the reason for your performace loss. Also that the MySQL.pm was removed in 4.x line of DBD::mysql, it last appeared in 2006.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值