card_captor (1513) の日記
2003 年 04 月 12 日
午前 08:52
64bytesの(1<<32)回コピー
cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
usage: cc [ options] files. Use 'cc -flags' for details
┌────────────────┬─────┬─────┬─────┐
│ │ memcpy │ memmove │ bcopy │
├────────────────┼─────┼─────┼─────┤
│Forte C/32bit/no_opt │959.729ms │978.375ms │1117.33ms │
│ ├─────┼─────┼─────┤
│ │954.291ms │952.634ms │1105.89ms │
│ ├─────┼─────┼─────┤
│ │963.027ms │962.682ms │1112.41ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/32bit/opt,no_inline │1264.66ms │1239.02ms │1379.17ms │
│ ├─────┼─────┼─────┤
│ │1246.38ms │1244.47ms │1405.1ms │
│ ├─────┼─────┼─────┤
│ │1242.07ms │1239.78ms │1393.55ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/32bit/opt,allow_inline │1237.41ms │1238.82ms │1405.66ms │
│ ├─────┼─────┼─────┤
│ │1240.94ms │1237.12ms │1386.11ms │
│ ├─────┼─────┼─────┤
│ │1238.22ms │1242.97ms │1375.37ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/64bit/no_opt │1292.79ms │1281.42ms │1489.49ms │
│ ├─────┼─────┼─────┤
│ │1287.52ms │1290.26ms │1484.55ms │
│ ├─────┼─────┼─────┤
│ │1295.44ms │1290.92ms │1513.92ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/64bit/opt,no_inline │1220.62ms │1289.9ms │1393.28ms │
│ ├─────┼─────┼─────┤
│ │1203.1ms │1287.9ms │1406.86ms │
│ ├─────┼─────┼─────┤
│ │1207.28ms │1292.14ms │1401.22ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/64bit/opt,allow_inline │1206.95ms │1282.43ms │1409.33ms │
│ ├─────┼─────┼─────┤
│ │1213.49ms │1286.85ms │1403.06ms │
│ ├─────┼─────┼─────┤
│ │1216.24ms │1289.97ms │1391.13ms │
└────────────────┴─────┴─────┴─────┘
GCC
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.2
┌──────────────┬─────┬─────┬─────┐
│ │ memcpy │ memmove │ bcopy │
├──────────────┼─────┼─────┼─────┤
│GCC/32bit/no_opt │1129.17ms │1095.98ms │1229.48ms │
│ ├─────┼─────┼─────┤
│ │1090.24ms │1113.02ms │1223.69ms │
│ ├─────┼─────┼─────┤
│ │1097.22ms │1097.51ms │1242.38ms │
├──────────────┼─────┼─────┼─────┤
│GCC/32bit/opt,no_inline │1023.46ms │1057.34ms │1158.33ms │
│ ├─────┼─────┼─────┤
│ │998.344ms │1072.91ms │1140.44ms │
│ ├─────┼─────┼─────┤
│ │1009.63ms │1058.39ms │1144.06ms │
├──────────────┼─────┼─────┼─────┤
│GCC/32bit/opt,allow_inline │1020.94ms │992.931ms │1161.46ms │
│ ├─────┼─────┼─────┤
│ │1000.73ms │995.157ms │1158.87ms │
│ ├─────┼─────┼─────┤
│ │1003.21ms │975.871ms │1149.8ms │
├──────────────┼─────┼─────┼─────┤
│GCC/64bit/no_opt │1118.22ms │1129.08ms │1273.41ms │
│ ├─────┼─────┼─────┤
│ │1092.9ms │1116.53ms │1255.53ms │
│ ├─────┼─────┼─────┤
│ │1085.94ms │1107.94ms │1287.05ms │
├──────────────┼─────┼─────┼─────┤
│GCC/64bit/opt,no_inline │933.235ms │985.083ms │1086.61ms │
│ ├─────┼─────┼─────┤
│ │930.083ms │992.475ms │1117.17ms │
│ ├─────┼─────┼─────┤
│ │915.812ms │993.073ms │1081.58ms │
├──────────────┼─────┼─────┼─────┤
│GCC/64bit/opt,allow_inline │1046.52ms │1038.08ms │1218.34ms │
│ ├─────┼─────┼─────┤
│ │1049.97ms │1028.59ms │1205.77ms │
│ ├─────┼─────┼─────┤
│ │1048.44ms │1039.98ms │1224.49ms │
└──────────────┴─────┴─────┴─────┘
- コメント無効
午前 08:50
4MB×64回コピー
cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
usage: cc [ options] files. Use 'cc -flags' for details
┌────────────────┬─────┬─────┬─────┐
│ │ memcpy │ memmove │ bcopy │
├────────────────┼─────┼─────┼─────┤
│Forte C/32bit/no_opt │1709.42ms │1635.72ms │1637.02ms │
│ ├─────┼─────┼─────┤
│ │1679.98ms │1641.67ms │1637.22ms │
│ ├─────┼─────┼─────┤
│ │1708.42ms │1635.9ms │1636.1ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/32bit/opt,no_inline │1688.6ms │1636ms │1635.52ms │
│ ├─────┼─────┼─────┤
│ │1724.67ms │1637.46ms │1635.55ms │
│ ├─────┼─────┼─────┤
│ │1690.83ms │1639.12ms │1639.17ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/32bit/opt,allow_inline │1681.58ms │1637.22ms │1643.29ms │
│ ├─────┼─────┼─────┤
│ │1680.13ms │1635.56ms │1643.6ms │
│ ├─────┼─────┼─────┤
│ │1681.1ms │1636.26ms │1644.7ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/64bit/no_opt │1676.35ms │1669.25ms │1632.66ms │
│ ├─────┼─────┼─────┤
│ │1678.76ms │1655.12ms │1646.11ms │
│ ├─────┼─────┼─────┤
│ │1678.33ms │1638.68ms │1634.25ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/64bit/opt,no_inline │1687.82ms │1635.19ms │1632.85ms │
│ ├─────┼─────┼─────┤
│ │1687.81ms │1635.46ms │1634.81ms │
│ ├─────┼─────┼─────┤
│ │1685.39ms │1633.62ms │1634.35ms │
├────────────────┼─────┼─────┼─────┤
│Forte C/64bit/opt,allow_inline │1678.19ms │1663.81ms │1642.25ms │
│ ├─────┼─────┼─────┤
│ │1716.16ms │1673.59ms │1642.11ms │
│ ├─────┼─────┼─────┤
│ │1678.19ms │1633.03ms │1639.83ms │
└────────────────┴─────┴─────┴─────┘
GCC
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.2
┌──────────────┬─────┬─────┬─────┐
│ │ memcpy │ memmove │ bcopy │
├──────────────┼─────┼─────┼─────┤
│GCC/32bit/no_opt │1682.42ms │1656.63ms │1636.18ms │
│ ├─────┼─────┼─────┤
│ │1681.88ms │1636.2ms │1644.02ms │
│ ├─────┼─────┼─────┤
│ │1680.57ms │1635.33ms │1679.73ms │
├──────────────┼─────┼─────┼─────┤
│GCC/32bit/opt,no_inline │1680.17ms │1644.38ms │1635.89ms │
│ ├─────┼─────┼─────┤
│ │1689.4ms │1652.63ms │1636.74ms │
│ ├─────┼─────┼─────┤
│ │1679.93ms │1642.99ms │1637.18ms │
├──────────────┼─────┼─────┼─────┤
│GCC/32bit/opt,allow_inline │1681.32ms │1645.57ms │1636.49ms │
│ ├─────┼─────┼─────┤
│ │1681.73ms │1643.93ms │1636.6ms │
│ ├─────┼─────┼─────┤
│ │1680.65ms │1676.69ms │1636.05ms │
├──────────────┼─────┼─────┼─────┤
│GCC/64bit/no_opt │1694ms │1646.43ms │1635.47ms │
│ ├─────┼─────┼─────┤
│ │1680.28ms │1652.92ms │1634.27ms │
│ ├─────┼─────┼─────┤
│ │1681.64ms │1642.99ms │1635.2ms │
├──────────────┼─────┼─────┼─────┤
│GCC/64bit/opt,no_inline │1678.31ms │1643.49ms │1635.36ms │
│ ├─────┼─────┼─────┤
│ │1680.38ms │1644.61ms │1635.89ms │
│ ├─────┼─────┼─────┤
│ │1680.22ms │1679.97ms │1636.59ms │
├──────────────┼─────┼─────┼─────┤
│GCC/64bit/opt,allow_inline │1688.99ms │1635.82ms │1636.36ms │
│ ├─────┼─────┼─────┤
│ │1687.19ms │1646.9ms │1636.93ms │
│ ├─────┼─────┼─────┤
│ │1686.74ms │1636.96ms │1636.35ms │
└──────────────┴─────┴─────┴─────┘
- コメント無効
午前 08:48
ソースその2
Content-Transf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SDcFb
RTc/3c6gdXr7Q9hG6XQIN9n7Op928gtT8uXl3tScK28bOEJyIqF9iYmEOpjsewB6K1cjPBzG
z/KaLiVlHV3tOeXG20EHe5JKm+Fh1JPNsw62B/fRuOm+oYNpc9PtzWQ59mvAwsLCwsLCwsLC
wsLCwsLCwsLCwsLiJ8O/VVCVpwAoAAA=
- コメント無効
2003 年 04 月 11 日
午前 01:31
bar.c
#include <stdio.h>
void prepare(char *buf)
{
(void)buf;
return;
}
clock_t start(void)
{
return clock();
}
void stop(const *s, clock_t start)
{
printf("%s: %g [ms]\n", s, (clock() - start) * 1000.0 / CLOCKS_PER_SEC);
}
- コメント無効
午前 01:31
foo.c
#include <string.h>
#define SIZE 1024 * 1024 * 4
#define LOOP 64
void prepare(char *buf);
clock_t start(void);
void stop(const char *s, clock_t start);
char src[SIZE];
char dst[SIZE];
int main(int argc, char *argv[])
{
int i;
clock_t s;
s = start();
for(i = 0; i < LOOP; i++) {
prepare(src);
memcpy(dst, src, sizeof(dst));
}
stop("memcpy", s);
s = start();
for(i = 0; i < LOOP; i++) {
prepare(src);
memmove(dst, src, sizeof(dst));
}
stop("memmove", s);
s = start();
for(i = 0; i < LOOP; i++) {
prepare(src);
bcopy(src, dst, sizeof(dst));
}
stop("bcopy", s);
return 0;
}
- コメント無効
午前 01:30
計測スクリプト
LANG=C; export LANG
echo "----- Forte C"
cc -V
echo "----- Forte C/32bit"
cc -c foo.c
cc -c bar.c
cc foo.o bar.o
./a.out
./a.out
rm *.o a.out
echo "----- Forte C/64bit"
cc -xarch=native64 -c foo.c
cc -xarch=native64 -c bar.c
cc -xarch=native64 foo.o bar.o
./a.out
./a.out
rm *.o a.out
echo "----- GCC"
gcc -v
echo "----- GCC/32bit"
gcc -c foo.c
gcc -c bar.c
gcc foo.o bar.o
./a.out
./a.out
rm *.o a.out
echo "----- GCC/64bit"
gcc -mcpu=v9 -c foo.c
gcc -mcpu=v9 -c bar.c
gcc -mcpu=v9 foo.o bar.o
./a.out
./a.out
rm *.o a.out
- コメント無効
午前 01:29
結果
cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
usage: cc [ options] files. Use 'cc -flags' for details
----- Forte C/32bit
memcpy: 1680 [ms]
memmove: 1650 [ms]
bcopy: 1650 [ms]
memcpy: 1690 [ms]
memmove: 1640 [ms]
bcopy: 1660 [ms]
----- Forte C/64bit
memcpy: 1690 [ms]
memmove: 1640 [ms]
bcopy: 1640 [ms]
memcpy: 1690 [ms]
memmove: 1630 [ms]
bcopy: 1640 [ms]
----- GCC
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.2
----- GCC/32bit
memcpy: 1690 [ms]
memmove: 1640 [ms]
bcopy: 1640 [ms]
memcpy: 1690 [ms]
memmove: 1640 [ms]
bcopy: 1650 [ms]
----- GCC/64bit
memcpy: 1690 [ms]
memmove: 1640 [ms]
bcopy: 1640 [ms]
memcpy: 1680 [ms]
memmove: 1650 [ms]
bcopy: 1640 [ms]
- コメント無効
| 一覧