Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3809
  • 博文数量: 1
  • 博客积分: 196
  • 博客等级: 入伍新兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-06 10:55
文章分类
文章存档

2010年(1)

我的朋友
最近访客

分类:

2010-10-06 11:18:23

只是单纯地记录数据,不解释,欢迎评论。

测试对象:
free(p = malloc(size));

测试有效性验证:
p != NULL

记录:
$ uname -a
Linux hpslaptop 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:05:27 UTC 2010 x86_64 GNU/Linux

$ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ./malloc 1k 100000000
test success
start: 0
end: 6500000
CLOCKS_PER_SEC: 1000000
run time: 6500.00ms
test cycle: 100000000
avg cost: 0.000065ms

$ ./malloc 2k 100000000
test success
start: 0
end: 6500000
CLOCKS_PER_SEC: 1000000
run time: 6500.00ms
test cycle: 100000000
avg cost: 0.000065ms

$ ./malloc 4k 100000000
test success
start: 0
end: 6450000
CLOCKS_PER_SEC: 1000000
run time: 6450.00ms
test cycle: 100000000
avg cost: 0.000064ms

$ ./malloc 8k 100000000
test success
start: 0
end: 6550000
CLOCKS_PER_SEC: 1000000
run time: 6550.00ms
test cycle: 100000000
avg cost: 0.000066ms

$ ./malloc 16k 100000000
test success
start: 0
end: 6570000
CLOCKS_PER_SEC: 1000000
run time: 6570.00ms
test cycle: 100000000
avg cost: 0.000066ms

$ ./malloc 32k 100000000
test success
start: 0
end: 6570000
CLOCKS_PER_SEC: 1000000
run time: 6570.00ms
test cycle: 100000000
avg cost: 0.000066ms

$ ./malloc 64k 100000000
test success
start: 0
end: 6550000
CLOCKS_PER_SEC: 1000000
run time: 6550.00ms
test cycle: 100000000
avg cost: 0.000066ms

$ ./malloc 128k 100000000
test success
start: 0
end: 5580000
CLOCKS_PER_SEC: 1000000
run time: 5580.00ms
test cycle: 100000000
avg cost: 0.000056ms

$ ./malloc 256k 100000000
test success
start: 0
end: 5670000
CLOCKS_PER_SEC: 1000000
run time: 5670.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 512k 100000000
test success
start: 0
end: 5660000
CLOCKS_PER_SEC: 1000000
run time: 5660.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 1m 100000000
test success
start: 0
end: 5660000
CLOCKS_PER_SEC: 1000000
run time: 5660.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 2m 100000000
test success
start: 0
end: 5670000
CLOCKS_PER_SEC: 1000000
run time: 5670.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 4m 100000000
test success
start: 0
end: 5670000
CLOCKS_PER_SEC: 1000000
run time: 5670.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 8m 100000000
test success
start: 0
end: 5680000
CLOCKS_PER_SEC: 1000000
run time: 5680.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 16m 100000000
test success
start: 0
end: 5700000
CLOCKS_PER_SEC: 1000000
run time: 5700.00ms
test cycle: 100000000
avg cost: 0.000057ms

$ ./malloc 32m 1000000
test success
start: 0
end: 5760000
CLOCKS_PER_SEC: 1000000
run time: 5760.00ms
test cycle: 1000000
avg cost: 0.005760ms

$ ./malloc 64m 1000000
test success
start: 0
end: 5280000
CLOCKS_PER_SEC: 1000000
run time: 5280.00ms
test cycle: 1000000
avg cost: 0.005280ms

$ ./malloc 128m 1000000
test success
start: 0
end: 6040000
CLOCKS_PER_SEC: 1000000
run time: 6040.00ms
test cycle: 1000000
avg cost: 0.006040ms

$ ./malloc 256m 1000000
test success
start: 0
end: 7240000
CLOCKS_PER_SEC: 1000000
run time: 7240.00ms
test cycle: 1000000
avg cost: 0.007240ms

$ ./malloc 512m 1000000
test success
start: 0
end: 8070000
CLOCKS_PER_SEC: 1000000
run time: 8070.00ms
test cycle: 1000000
avg cost: 0.008070ms

$ ./malloc 1g 1000000
test success
start: 0
end: 9580000
CLOCKS_PER_SEC: 1000000
run time: 9580.00ms
test cycle: 1000000
avg cost: 0.009580ms

$ ./malloc 2g 1000000
test success
start: 0
end: 9490000
CLOCKS_PER_SEC: 1000000
run time: 9490.00ms
test cycle: 1000000
avg cost: 0.009490ms

阅读(992) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~