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
This commit is contained in:
parent
731072de7a
commit
191bd3da93
1 changed files with 25 additions and 0 deletions
|
@ -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++)
|
||||
|
|
Loading…
Reference in a new issue