diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-02-25 09:57:18 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-02-25 09:57:18 +0100 |
commit | 191bd3da9335e434bd3076160a2677f7210b9678 (patch) | |
tree | 7fc3b714e4a8114e3079d370557562212f84a58f /apps | |
parent | 731072de7acfbbeacd992eea1274bc8f35a42163 (diff) | |
download | rockbox-191bd3da9335e434bd3076160a2677f7210b9678.tar.gz rockbox-191bd3da9335e434bd3076160a2677f7210b9678.zip |
test_disk: Add an additional dirscan test that calls dir_get_info() also.
Especially on hosted dir_get_info() can be relatively. It is commonly called
after every readdir() for further information about the dir entry. So it's
peformance compared to readdir()-only is interesting.
Change-Id: I03ab41fb190acf738e04a5d3b2a4fe29276094f6
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/test_disk.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index 332cc1cb08..ac29f18093 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c | |||
@@ -369,6 +369,31 @@ static bool test_speed(void) | |||
369 | rb->snprintf(text_buf, sizeof(text_buf), "Dirscan: %d files/s", n / TEST_TIME); | 369 | rb->snprintf(text_buf, sizeof(text_buf), "Dirscan: %d files/s", n / TEST_TIME); |
370 | log_text(text_buf, true); | 370 | log_text(text_buf, true); |
371 | 371 | ||
372 | dir = NULL; | ||
373 | entry = NULL; | ||
374 | /* Directory scan speed 2 */ | ||
375 | time = *rb->current_tick + TEST_TIME*HZ; | ||
376 | for (n = 0; TIME_BEFORE(*rb->current_tick, time); n++) | ||
377 | { | ||
378 | if (entry == NULL) | ||
379 | { | ||
380 | if (dir != NULL) | ||
381 | rb->closedir(dir); | ||
382 | dir = rb->opendir(testbasedir); | ||
383 | if (dir == NULL) | ||
384 | { | ||
385 | rb->splash(HZ, "opendir() failed."); | ||
386 | goto error; | ||
387 | } | ||
388 | } | ||
389 | else | ||
390 | (void) rb->dir_get_info(dir, entry); | ||
391 | entry = rb->readdir(dir); | ||
392 | } | ||
393 | rb->closedir(dir); | ||
394 | rb->snprintf(text_buf, sizeof(text_buf), "Dirscan w info: %d files/s", n / TEST_TIME); | ||
395 | log_text(text_buf, true); | ||
396 | |||
372 | /* File delete speed */ | 397 | /* File delete speed */ |
373 | time = *rb->current_tick; | 398 | time = *rb->current_tick; |
374 | for (i = 0; i < last_file; i++) | 399 | for (i = 0; i < last_file; i++) |