summaryrefslogtreecommitdiffstats
path: root/results.txt
blob: 3618ec5b695ce274ed15e1a15ef92dfb37cc8ad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
-- These tests conducted on a laptop --

1st run, with only posix-fallocate on ext3
$ ./test-file-zero-speed
seconds:microseconds: 1235557175:156446
seconds:microseconds: 1235557212:186703

-------------------------------------------------------------------

2nd run, same program as above
$ ./test-file-zero-speed
seconds:microseconds: 1235557363:187840
seconds:microseconds: 1235557396:43475

-------------------------------------------------------------------

3rd run, same program (with no printf between gtod() and actual call)
$ ./test-file-zero-speed
posix-fallocate run time:
      seconds:microseconds: 1235558782:292459
      seconds:microseconds: 1235558816:331028
      (approx 34s)
$ sudo filefrag ../tmp/10gfile-pf
../tmp/10gfile-pf: 134 extents found, perfection would be 9 extents

-------------------------------------------------------------------

With all three:
$ ./test-file-zero-speed
posix-fallocate run time:
      seconds:microseconds: 1235569716:953548
      seconds:microseconds: 1235569749:595276
      (approx 33s)
mmap run time:
      seconds:microseconds: 1235569749:595577
      seconds:microseconds: 1235569789:622942
      (approx 40s)
4096-sized chunk run time:
      seconds:microseconds: 1235569791:134534
      seconds:microseconds: 1235569839:132586
      (approx 48s)
$ sudo filefrag ../tmp/*
../tmp/file-chunk: 57 extents found, perfection would be 9 extents
../tmp/file-mmap: 106 extents found, perfection would be 9 extents
../tmp/file-pf: 132 extents found, perfection would be 9 extents

-------------------------------------------------------------------

Added free(), 8k-chunk, close(fd) in time calculation

$ free -m                                            
             total       used       free     shared    buffers     cached
Mem:          1954        859       1095          0          7        388
-/+ buffers/cache:        462       1491                                 
Swap:         4094        742       3351                                 
$ ./test-file-zero-speed                             
posix-fallocate run time:                                                
        seconds:microseconds: 1235571071:797642                          
       seconds:microseconds: 1235571104:428998                          
       (approx 33s)                                                     
mmap run time:                                                           
       seconds:microseconds: 1235571104:429523                          
       seconds:microseconds: 1235571147:770146                          
       (approx 43s)                                                     
4096-sized chunk run time:                                               
       seconds:microseconds: 1235571149:318119                          
       seconds:microseconds: 1235571187:731919                          
       (approx 38s)                                                     
8192-sized chunk run time:                                               
       seconds:microseconds: 1235571189:614692                          
       seconds:microseconds: 1235571228:355714                          
       (approx 39s)                                                     
$ free -m                                            
            total       used       free     shared    buffers     cached
Mem:          1954        853       1101          0          1        415
-/+ buffers/cache:        436       1517                                 
Swap:         4094        742       3351                                 
$ sudo filefrag ../tmp/*                             
[sudo] password for amit:                                                
../tmp/file-chunk4: 60 extents found, perfection would be 9 extents      
../tmp/file-chunk8: 86 extents found, perfection would be 9 extents      
../tmp/file-mmap: 117 extents found, perfection would be 9 extents       
../tmp/file-pf: 133 extents found, perfection would be 9 extents

-------------------------------------------------------------------


-- These tests conducted on a desktop --

$ sudo ./test-file-zero-speed /mnt/btrfs/
posix-fallocate run time:
       seconds:microseconds: 1235757533:559903
       seconds:microseconds: 1235757533:560119
       (approx 0s)
mmap run time:
       seconds:microseconds: 1235757533:564220
       seconds:microseconds: 1235757551:589402
       (approx 18s)
4096-sized chunk run time:
       seconds:microseconds: 1235757552:688346
       seconds:microseconds: 1235757572:585343
       (approx 20s)
8192-sized chunk run time:
       seconds:microseconds: 1235757576:143821
       seconds:microseconds: 1235757592:424030
       (approx 16s)

-------------------------------------------------------------------

sudo ./test-file-zero-speed /mnt/ext4/
posix-fallocate run time:
       seconds:microseconds: 1235757627:972541
       seconds:microseconds: 1235757642:159940
       (approx 15s)
mmap run time:
       seconds:microseconds: 1235757643:901565
       seconds:microseconds: 1235757646:690830
       (approx 3s)
4096-sized chunk run time:
       seconds:microseconds: 1235757647:879737
       seconds:microseconds: 1235757668:701027
       (approx 21s)
8192-sized chunk run time:
       seconds:microseconds: 1235757670:722389
       seconds:microseconds: 1235757686:780528
       (approx 16s)

-------------------------------------------------------------------
[ Extents were not enabled]

$ sudo ./test-file-zero-alloc-speed /mnt/ext4
posix-fallocate run time:
        seconds:microseconds: 1235977123:542643
        seconds:microseconds: 1235977137:673307
        (approx 14s)
mmap run time:
        seconds:microseconds: 1235977137:673494
        seconds:microseconds: 1235977154:435404
        (approx 17s)
4096-sized chunk run time:
        seconds:microseconds: 1235977155:826068
        seconds:microseconds: 1235977173:98883
        (approx 18s)
8192-sized chunk run time:
        seconds:microseconds: 1235977174:91821
        seconds:microseconds: 1235977190:862035
        (approx 16s)

$ sudo filefrag /mnt/ext4/*
/mnt/ext4/file-chunk4: 292 extents found, perfection would be 9 extents
/mnt/ext4/file-chunk8: 282 extents found, perfection would be 9 extents
/mnt/ext4/file-mmap: 295 extents found, perfection would be 9 extents
/mnt/ext4/file-pf: 279 extents found, perfection would be 9 extents

-------------------------------------------------------------------

[After enabling extents]
$ sudo ./test-file-zero-alloc-speed /mnt/ext4
posix-fallocate run time:
        seconds:microseconds: 1235979104:790662
        seconds:microseconds: 1235979104:848372
        (approx 0s)
mmap run time:
        seconds:microseconds: 1235979105:33407
        seconds:microseconds: 1235979118:535711
        (approx 13s)
4096-sized chunk run time:
        seconds:microseconds: 1235979120:297221
        seconds:microseconds: 1235979135:520910
        (approx 15s)
8192-sized chunk run time:
        seconds:microseconds: 1235979135:639915
        seconds:microseconds: 1235979153:502270
        (approx 18s)

$ sudo filefrag /mnt/ext4/*
File is stored in extents format
/mnt/ext4/file-chunk4: 29 extents found
File is stored in extents format
/mnt/ext4/file-chunk8: 20 extents found
File is stored in extents format
/mnt/ext4/file-mmap: 38 extents found
File is stored in extents format
/mnt/ext4/file-pf: 1 extent found

-------------------------------------------------------------------
$ sudo ./test-file-zero-alloc-speed /mnt/xfs/
posix-fallocate run time:
        seconds:microseconds: 1235977241:411119
        seconds:microseconds: 1235977241:469611
        (approx 0s)
mmap run time:
        seconds:microseconds: 1235977241:469981
        seconds:microseconds: 1235977255:687663
        (approx 14s)
4096-sized chunk run time:
        seconds:microseconds: 1235977256:603450
        seconds:microseconds: 1235977274:549963
        (approx 18s)
8192-sized chunk run time:
        seconds:microseconds: 1235977274:649325
        seconds:microseconds: 1235977293:365759
        (approx 19s)

$ sudo filefrag /mnt/xfs/*
/mnt/xfs/file-chunk4: 3 extents found
/mnt/xfs/file-chunk8: 4 extents found
/mnt/xfs/file-mmap: 2 extents found
/mnt/xfs/file-pf: 1 extent found
-------------------------------------------------------------------
$ sudo ./test-file-zero-alloc-speed /mnt/ext3/
posix-fallocate run time:
        seconds:microseconds: 1235977308:469496
        seconds:microseconds: 1235977326:366806
        (approx 18s)
mmap run time:
        seconds:microseconds: 1235977326:367325
        seconds:microseconds: 1235977346:260276
        (approx 20s)
4096-sized chunk run time:
        seconds:microseconds: 1235977347:161513
        seconds:microseconds: 1235977369:771397
        (approx 22s)
8192-sized chunk run time:
        seconds:microseconds: 1235977369:865221
        seconds:microseconds: 1235977393:23403
        (approx 24s)

$ sudo filefrag /mnt/ext3/*
/mnt/ext3/file-chunk4: 38 extents found, perfection would be 9 extents
/mnt/ext3/file-chunk8: 9 extents found
/mnt/ext3/file-mmap: 44 extents found, perfection would be 9 extents
/mnt/ext3/file-pf: 9 extents found
-------------------------------------------------------------------
$ sudo ./test-file-zero-alloc-speed /mnt/btrfs/
posix-fallocate run time:
        seconds:microseconds: 1235977416:649716
        seconds:microseconds: 1235977416:650009
        (approx 0s)
mmap run time:
        seconds:microseconds: 1235977416:650118
        seconds:microseconds: 1235977434:626664
        (approx 18s)
4096-sized chunk run time:
        seconds:microseconds: 1235977435:634000
        seconds:microseconds: 1235977452:208026
        (approx 17s)
8192-sized chunk run time:
        seconds:microseconds: 1235977452:294473
        seconds:microseconds: 1235977471:143672
        (approx 19s)

$ sudo /mnt/btrfs/*
FIBMAP: Invalid argument
...
-------------------------------------------------------------------
-------------------------------------------------------------------