ITPub博客

首页 > Linux操作系统 > Linux操作系统 > shell文本处理能力

shell文本处理能力

原创 Linux操作系统 作者:motina 时间:2012-08-31 16:04:16 0 删除 编辑
今天测试了下shell文本处理能力,log文件大约3w行.从测试结果来看,循环只用了0.5s,
而每秒只能处理1000行文本.这样的效率看样子只能使用perl或者python了
[root@swdba1 opt]# time while read line ; do s=$line ;  done <  mysqld-slow.log

real    0m0.469s
user    0m0.404s
sys     0m0.065s
[root@swdba1 opt]# time while read line ; do echo $line | grep "user";  done <  mysqld-slow.log                           

real    0m33.223s
user    0m12.945s
sys     0m32.477s

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/510494/viewspace-742367/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 第一篇帖子
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2012-08-08

  • 博文量
    2
  • 访问量
    3948

最新文章