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 | |
parent | 731072de7acfbbeacd992eea1274bc8f35a42163 (diff) | |
download | rockbox-191bd3d.tar.gz rockbox-191bd3d.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
-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) rb->snprintf(text_buf, sizeof(text_buf), "Dirscan: %d files/s", n / TEST_TIME); log_text(text_buf, true); + dir = NULL; + entry = NULL; + /* Directory scan speed 2 */ + time = *rb->current_tick + TEST_TIME*HZ; + for (n = 0; TIME_BEFORE(*rb->current_tick, time); n++) + { + if (entry == NULL) + { + if (dir != NULL) + rb->closedir(dir); + dir = rb->opendir(testbasedir); + if (dir == NULL) + { + rb->splash(HZ, "opendir() failed."); + goto error; + } + } + else + (void) rb->dir_get_info(dir, entry); + entry = rb->readdir(dir); + } + rb->closedir(dir); + rb->snprintf(text_buf, sizeof(text_buf), "Dirscan w info: %d files/s", n / TEST_TIME); + log_text(text_buf, true); + /* File delete speed */ time = *rb->current_tick; for (i = 0; i < last_file; i++) |