龙芯开源社区

 找回密码
 注册新用户(newuser)
楼主: jamesr

压缩、解压测试脚本

  [复制链接]
发表于 2008-7-9 16:51:05 | 显示全部楼层
使用新的目标文件后2F的bzip2速度有很大提高,但gzip速度基本没有变化,竟然以微弱差距负于PIII 800。
发表于 2008-7-9 17:22:45 | 显示全部楼层
cangku@3104-C /i/TDDOWNLOAD/yasuo.sh
$ yasuo.sh
正在生成32M测试文件...
./yasuo.sh: line 3: dd: command not found
测试文件生成完毕,测试å¼
发表于 2008-7-9 17:23:07 | 显示全部楼层
cangku@3104-C /i/TDDOWNLOAD/yasuo.sh
$ yasuo.sh
正在生成32M测试文件...
./yasuo.sh: line 3: dd: command not found
测试文件生成完毕,测试å¼
发表于 2008-7-9 17:24:25 | 显示全部楼层
cangku@3104-C /i/TDDOWNLOAD/yasuo.sh
$ yasuo.sh

cat: /proc/cpuinfo: No such file or directory
cat: /proc/version: No such file or directory
bzip2, a block-sorting file compressor.  Version 1.0.1, 23-June-2000.
   
   Copyright (C) 1996-2000 by Julian Seward.
   
   This program is free software; you can redistribute it and/or modify
   it under the terms set out in the LICENSE file, which is included
   in the bzip2-1.0 source distribution.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   LICENSE file for more details.
   
bzip2: I won't write compressed data to a terminal.
bzip2: For help, type: `bzip2 --help'.
gzip 1.2.4 (18 Aug 93)
Compilation options:
DIRENT UTIME HAVE_UNISTD_H ASMV

bzip2: Can't open input file testdata: No such file or directory.

real    0m0.032s
user    0m0.046s
sys     0m0.000s
bzip2: Can't open input file testdata.bz2: No such file or directory.

real    0m0.046s
user    0m0.060s
sys     0m0.030s
bzip2: Can't open input file testdata: No such file or directory.

real    0m0.016s
user    0m0.030s
sys     0m0.000s
bzip2: Can't open input file testdata.bz2: No such file or directory.

real    0m0.047s
user    0m0.060s
sys     0m0.045s
bzip2: Can't open input file testdata: No such file or directory.

real    0m0.016s
user    0m0.030s
sys     0m0.015s
bzip2: Can't open input file testdata.bz2: No such file or directory.

real    0m0.062s
user    0m0.060s
sys     0m0.061s

testdata: No such file or directory

real    0m0.016s
user    0m0.030s
sys     0m0.000s
testdata.gz: No such file or directory

real    0m0.047s
user    0m0.092s
sys     0m0.015s
testdata: No such file or directory

real    0m0.031s
user    0m0.030s
sys     0m0.015s
testdata.gz: No such file or directory

real    0m0.047s
user    0m0.076s
sys     0m0.015s
testdata: No such file or directory

real    0m0.015s
user    0m0.030s
sys     0m0.000s
testdata.gz: No such file or directory

real    0m0.047s
user    0m0.076s
sys     0m0.015s
发表于 2008-7-9 17:29:53 | 显示全部楼层
原帖由 jamesr 于 2008-7-9 13:25 发表


期待优化版的测试,优化参考参数也都已经给出了,编译一个bzip2和gzip应该是很快的。


我的结果中,bzip2部分就是优化过后的
发表于 2008-7-9 19:33:24 | 显示全部楼层
gzip经过针对pIII编译优化过的,bzip2没有源代码包中没有configure,不知道如何优化编译
另外gzip不知道是否真正做到优化编译
用的是
./configure CFLAGS='-O3 -march=pentium3'
不知道是否正确
以下为测试结果

系统信息:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 6
cpu MHz         : 799.799
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 mtrr pge mca cmov pat pse36 mmx fxsr sse up
bogomips        : 1600.55

Linux version 2.6.18-8.10AX (packager@asianux.com) (gcc version 4.1.1 20070105 (Asianux 3.0 4.1.1-52.2.1)) #1 SMP Tue Aug 14 04:52:14 EDT 2007
bzip2, a block-sorting file compressor.  Version 1.0.5, 10-Dec-2007.

   Copyright (C) 1996-2007 by Julian Seward.

   This program is free software; you can redistribute it and/or modify
   it under the terms set out in the LICENSE file, which is included
   in the bzip2-1.0.5 source distribution.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   LICENSE file for more details.

bzip2: I won't write compressed data to a terminal.
bzip2: For help, type: `bzip2 --help'.
gzip 1.2.4 (18 Aug 93)
Compilation options:
DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H ASMV
bzip2默认压缩,解压:

real    0m50.373s
user    0m46.936s
sys     0m0.569s

real    0m14.322s
user    0m13.000s
sys     0m0.892s

real    0m49.224s
user    0m47.057s
sys     0m0.558s

real    0m14.073s
user    0m12.872s
sys     0m0.895s

real    0m48.021s
user    0m46.955s
sys     0m0.530s

real    0m14.042s
user    0m12.847s
sys     0m0.932s
gzip默认压缩,解压:

real    0m11.801s
user    0m10.724s
sys     0m0.741s

real    0m2.512s
user    0m1.596s
sys     0m0.685s

real    0m13.183s
user    0m11.961s
sys     0m0.809s

real    0m2.403s
user    0m1.567s
sys     0m0.665s

real    0m12.239s
user    0m10.829s
sys     0m0.832s

real    0m2.466s
user    0m1.560s
sys     0m0.706s
测试完毕,删除测试文件



感觉这个也只是反映整个计算机系统压缩和解压缩能力
但从rmvb播放来看,龙芯2f是远强于同频piii的

[ 本帖最后由 zhcell 于 2008-7-9 19:34 编辑 ]
发表于 2008-7-9 20:30:05 | 显示全部楼层
原帖由 tanhitzq 于 2008-7-9 17:24 发表
cangku@3104-C /i/TDDOWNLOAD/yasuo.sh
$ yasuo.sh

cat: /proc/cpuinfo: No such file or directory
cat: /proc/version: No such file or directory
bzip2, a block-sorting file compressor.  Version ...

bzip2: Can't open input file testdata: No such file or directory.

real    0m0.032s
user    0m0.046s
sys     0m0.000s



就这么算了? 正确的数据呢?
发表于 2008-7-9 20:33:58 | 显示全部楼层
ok1985@ok1985-desktop:~$ #!/bin/bash
ok1985@ok1985-desktop:~$ echo "正在生成32M测试文件..."
正在生成32M测试文件...
ok1985@ok1985-desktop:~$ dd if=/dev/urandom of=testdata bs=4k count=8k

记录了 8192+0 的读入
记录了 8192+0 的写出
33554432字节(34 MB)已复制,8.02971 秒,4.2 MB/秒
ok1985@ok1985-desktop:~$ echo "测试文件生成完毕,测试开始"
测试文件生成完毕,测试开始
ok1985@ok1985-desktop:~$ echo "系统信息:"
系统信息:
ok1985@ok1985-desktop:~$ cat /proc/cpuinfo
processor        : 0
vendor_id        : GenuineIntel
cpu family        : 6
model                : 23
model name        : Intel(R) Core(TM)2 Duo CPU     E8200  @ 2.66GHz
stepping        : 8
cpu MHz                : 2671.225
cache size        : 6144 KB
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 10
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss lm constant_tsc up arch_perfmon pebs bts pni ds_cpl ssse3 cx16 lahf_lm
bogomips        : 5349.68
clflush size        : 64

ok1985@ok1985-desktop:~$ cat /proc/version
Linux version 2.6.24-18-generic (buildd@terranova) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Wed May 28 20:27:26 UTC 2008
ok1985@ok1985-desktop:~$ bzip2 -V
bzip2, a block-sorting file compressor.  Version 1.0.4, 20-Dec-2006.
   
   Copyright (C) 1996-2006 by Julian Seward.
   
   This program is free software; you can redistribute it and/or modify
   it under the terms set out in the LICENSE file, which is included
   in the bzip2-1.0.4 source distribution.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   LICENSE file for more details.
   
ok1985@ok1985-desktop:~$ gzip -V
gzip 1.3.12
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.
ok1985@ok1985-desktop:~$ echo "bzip2默认压缩,解压:"
bzip2默认压缩,解压:
ok1985@ok1985-desktop:~$ for((i=1;i<=3;i=i+1))
> do
> time bzip2 testdata
> time bunzip2 testdata.bz2
> done

real        0m12.307s
user        0m9.185s
sys        0m0.692s

real        0m4.877s
user        0m3.792s
sys        0m0.428s

real        0m10.673s
user        0m9.021s
sys        0m0.356s

real        0m5.006s
user        0m3.848s
sys        0m0.384s

real        0m10.259s
user        0m8.989s
sys        0m0.256s

real        0m4.816s
user        0m3.960s
sys        0m0.424s
ok1985@ok1985-desktop:~$ echo "gzip默认压缩,解压:"
gzip默认压缩,解压:
ok1985@ok1985-desktop:~$ for((i=1;i<=3;i=i+1))
> do
> time gzip testdata
> time gunzip testdata.gz
> done

real        0m2.833s
user        0m1.732s
sys        0m0.324s

real        0m0.588s
user        0m0.180s
sys        0m0.252s

real        0m2.577s
user        0m1.664s
sys        0m0.392s

real        0m0.532s
user        0m0.220s
sys        0m0.216s

real        0m2.588s
user        0m1.780s
sys        0m0.248s

real        0m0.499s
user        0m0.192s
sys        0m0.212s
ok1985@ok1985-desktop:~$ echo "测试完毕,删除测试文件"
测试完毕,删除测试文件
ok1985@ok1985-desktop:~$ rm -f testdata
ok1985@ok1985-desktop:~$
发表于 2008-7-9 21:01:48 | 显示全部楼层
Tualatin 1G

系统信息:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 11
model name      : Intel(R) Celeron(TM) CPU                1000MHz
stepping        : 1
cpu MHz         : 996.778
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse up
bogomips        : 1994.79

Linux version 2.6.18-6-686 (Debian 2.6.18.dfsg.1-18etch1) (waldi@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Sun Feb 10 22:11:31 UTC 2008
bzip2, a block-sorting file compressor.  Version 1.0.3, 15-Feb-2005.

   Copyright (C) 1996-2005 by Julian Seward.

   This program is free software; you can redistribute it and/or modify
   it under the terms set out in the LICENSE file, which is included
   in the bzip2-1.0 source distribution.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   LICENSE file for more details.

gzip 1.3.5
(2002-09-30)
Copyright 2002 Free Software Foundation
Copyright 1992-1993 Jean-loup Gailly
This program comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Compilation options:
DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H HAVE_MEMORY_H HAVE_STRING_H HAVE_LSTAT ASMV
Written by Jean-loup Gailly.
bzip2默认压缩,解压:

real    0m42.419s
user    0m38.726s
sys     0m0.400s

real    0m16.194s
user    0m13.825s
sys     0m0.860s

real    0m42.680s
user    0m38.798s
sys     0m0.396s

real    0m16.134s
user    0m13.933s
sys     0m0.752s

real    0m42.534s
user    0m38.818s
sys     0m0.404s

real    0m16.078s
user    0m13.853s
sys     0m0.740s
gzip默认压缩,解压:

real    0m12.621s
user    0m10.153s
sys     0m0.604s

real    0m2.568s
user    0m1.512s
sys     0m0.520s

real    0m12.241s
user    0m10.197s
sys     0m0.556s

real    0m2.576s
user    0m1.508s
sys     0m0.544s

real    0m12.346s
user    0m10.221s
sys     0m0.580s

real    0m2.560s
user    0m1.536s
sys     0m0.508s
测试完毕,删除测试文件
发表于 2008-7-9 21:52:22 | 显示全部楼层
综合此贴及penryn那个贴,初步判断,2F800在压缩解压方面与Tualatin 1G水平相当。由于压缩解压是CPU,主板,内存等方面综合能力的体现,是不是可以认为……

更有趣的是我的A901的主板是SIS630,集成的是S300估计与2F的SIS315差不多。那么这是不是意味着我从6年前就开始体验2F盒子/小本?

本版积分规则

小黑屋|手机版|Archiver|Lemote Inc.  

GMT+8, 2019-9-17 18:23 , Processed in 0.203844 second(s), 15 queries .

快速回复 返回顶部 返回列表