From a2241fb4bc33375ffeb1cb479e464d87ce1c8cb6 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 17 May 2018 19:12:45 +0800 Subject: [PATCH] tests: Increase performance threshold for VFS running with PSRAM Cache effects on microbenchmarks in cached flash can be significant, depending on linker layout in flash. --- components/idf_test/include/idf_performance.h | 3 +++ components/vfs/test/test_vfs_fd.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/components/idf_test/include/idf_performance.h b/components/idf_test/include/idf_performance.h index 40c733f03..f98f75c31 100644 --- a/components/idf_test/include/idf_performance.h +++ b/components/idf_test/include/idf_performance.h @@ -16,7 +16,10 @@ #define IDF_PERFORMANCE_MAX_ESP_TIMER_GET_TIME_PER_CALL 1000 #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING 30 #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING_NO_DMA 27 +/* Due to code size & linker layout differences interacting with cache, VFS + microbenchmark currently runs slower with PSRAM enabled. */ #define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME 20000 +#define IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME_PSRAM 40000 // throughput performance by iperf #define IDF_PERFORMANCE_MIN_TCP_RX_THROUGHPUT 50 #define IDF_PERFORMANCE_MIN_TCP_TX_THROUGHPUT 40 diff --git a/components/vfs/test/test_vfs_fd.c b/components/vfs/test/test_vfs_fd.c index a3c623653..c4292d3fc 100644 --- a/components/vfs/test/test_vfs_fd.c +++ b/components/vfs/test/test_vfs_fd.c @@ -257,5 +257,10 @@ TEST_CASE("Open & write & close through VFS passes performance test", "[vfs]") const int64_t time_diff_us = esp_timer_get_time() - begin; const int ns_per_iter = (int) (time_diff_us * 1000 / iter_count); TEST_ESP_OK( esp_vfs_unregister(VFS_PREF1) ); +#ifdef CONFIG_SPIRAM_SUPPORT + TEST_PERFORMANCE_LESS_THAN(VFS_OPEN_WRITE_CLOSE_TIME_PSRAM, "%dns", ns_per_iter); +#else TEST_PERFORMANCE_LESS_THAN(VFS_OPEN_WRITE_CLOSE_TIME, "%dns", ns_per_iter); +#endif + }