From 191bd3da9335e434bd3076160a2677f7210b9678 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 25 Feb 2014 09:57:18 +0100 Subject: 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 --- apps/plugins/test_disk.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps') 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++) -- cgit v1.2.3