- 论坛徽章:
- 0
|
是不是你内存不够?
我认为应该看 user+sys 时间,real 时间受内存限制,受缓存影响,受系统其他任务影响。
cp 使用的 sys 时间是 mmap 的 3 倍(系统调用使用的时间)。
我测试 mmap 不慢, AMD 3000+, 512M, FC5 , 140多M的文件:
[root@vc dio]# ls -l a
-rw-r--r-- 1 root root 147767160 Sep 6 08:53 a
[root@vc dio]# time ./mcp a 1
real 0m1.230s
user 0m0.332s
sys 0m0.340s
[root@vc dio]# time ./mcp a 2
real 0m5.171s
user 0m0.236s
sys 0m0.408s
[root@vc dio]# time ./mcp a 3
real 0m3.230s
user 0m0.320s
sys 0m0.308s
[root@vc dio]# time cp a 4
real 0m2.825s
user 0m0.044s
sys 0m1.008s
[root@vc dio]# time cp a 5
real 0m4.364s
user 0m0.016s
sys 0m1.088s
[root@vc dio]# time cp a 6
real 0m1.563s
user 0m0.016s
sys 0m1.036s
[[i] 本帖最后由 connet 于 2006-9-6 09:09 编辑 [/i]] |
|