1. Report on your system configuration! What type of file system are you working on?
# df -hT
Filesystem Type サイズ 使用 残り 使用% マウント位置
/dev/sda5 ext3 29G 6.1G 22G 23% /
varrun tmpfs 994M 112K 993M 1% /var/run
varlock tmpfs 994M 0 994M 0% /var/lock
udev tmpfs 994M 48K 993M 1% /dev
devshm tmpfs 994M 12K 994M 1% /dev/shm
lrm tmpfs 994M 40M 954M 4% /lib/modules/2.6.24-24-generic/volatile
2. Determine how long a file name your system supports. First, create a temporary directory to work in. Try creating files with different length names and see what happens.
255文字のファイル名のときにSegmentation faultが起きる
これはファイル名をchar型で宣言しているため、char型のサイズを超過したためである。
3. Now see how many files you can practically put in this directory. Time the creation of new files. How long does it take to create files 1-10? 101-110? 1,001-1,010? 10,001-10,010? Keep going until performance is too bad to continue, then time the deletion of the files. Plot the performance.
1-10 time: 0.000474929809570312500000000000
101-110 time: 0.000506401062011718750000000000
1,001-1,010 time: 0.000512361526489257812500000000
10,001-10,010 time: 0.000587701797485351562500000000
100,001-100,010 time: 0.000705718994140625000000000000
1,000,001-1,000,010 time: 0.000760078430175781250000000000
4. Now do something similar for depth: what happens as you create deeper directory trees?
A.Do this problem once with relative path names. Each time you create a directory, chdir() into it before proceeding.
1-10 time: 0.000515460968017578125000000000
101-110 time: 0.000478267669677734375000000000
1,001-1,010 time: 0.000493764877319335937500000000
10,001-10,010 time: 0.000223875045776367187500000000
100,001-100,010 time: 0.000257015228271484375000000000
1,000,001-1,000,010 time: 0.000296592712402343750000000000

0 件のコメント:
コメントを投稿