250
double m[3][2], v[3][2];
251
uint64_t cumul;
252
double cumul2;
253
+ int ntfs, hfs;
254
255
if (argc > 1 && !strcmp(argv[1], "--with-symlink-mode")) {
256
file_mode = 0120000;
277
names[i][--len] = (char)(' ' + (my_random() % ('\x7f' - ' ')));
278
}
279
279
- for (protect_ntfs = 0; protect_ntfs < 2; protect_ntfs++)
280
- for (protect_hfs = 0; protect_hfs < 2; protect_hfs++) {
280
+ if (!the_repository->gitdir)
281
+ the_repository->gitdir = xstrdup(".git");
282
+
283
+ for (ntfs = 0; ntfs < 2; ntfs++)
284
+ for (hfs = 0; hfs < 2; hfs++) {
285
+ repo_config_values(the_repository)->protect_ntfs = ntfs;
286
+ repo_config_values(the_repository)->protect_hfs = hfs;
287
cumul = 0;
288
cumul2 = 0;
289
for (i = 0; i < repetitions; i++) {
291
for (j = 0; j < nr; j++)
292
verify_path(names[j], file_mode);
293
end = getnanotime();
288
- printf("protect_ntfs = %d, protect_hfs = %d: %lfms\n", protect_ntfs, protect_hfs, (end-begin) / (double)1e6);
294
+ printf("protect_ntfs = %d, protect_hfs = %d: %lfms\n", ntfs, hfs, (end-begin) / (double)1e6);
295
cumul += end - begin;
296
cumul2 += (end - begin) * (end - begin);
297
}
292
- m[protect_ntfs][protect_hfs] = cumul / (double)repetitions;
293
- v[protect_ntfs][protect_hfs] = my_sqrt(cumul2 / (double)repetitions - m[protect_ntfs][protect_hfs] * m[protect_ntfs][protect_hfs]);
294
- printf("mean: %lfms, stddev: %lfms\n", m[protect_ntfs][protect_hfs] / (double)1e6, v[protect_ntfs][protect_hfs] / (double)1e6);
298
+ m[ntfs][hfs] = cumul / (double)repetitions;
299
+ v[ntfs][hfs] = my_sqrt(cumul2 / (double)repetitions - m[ntfs][hfs] * m[ntfs][hfs]);
300
+ printf("mean: %lfms, stddev: %lfms\n", m[ntfs][hfs] / (double)1e6, v[ntfs][hfs] / (double)1e6);
301
}
302
297
- for (protect_ntfs = 0; protect_ntfs < 2; protect_ntfs++)
298
- for (protect_hfs = 0; protect_hfs < 2; protect_hfs++)
299
- printf("ntfs=%d/hfs=%d: %lf%% slower\n", protect_ntfs, protect_hfs, (m[protect_ntfs][protect_hfs] - m[0][0]) * 100 / m[0][0]);
303
+ for (ntfs = 0; ntfs < 2; ntfs++)
304
+ for (hfs = 0; hfs < 2; hfs++)
305
+ printf("ntfs=%d/hfs=%d: %lf%% slower\n", ntfs, hfs, (m[ntfs][hfs] - m[0][0]) * 100 / m[0][0]);
306
307
return 0;
308
}