]> granicus.if.org Git - esp-idf/commitdiff
tests: Increase performance threshold for VFS running with PSRAM
authorAngus Gratton <angus@espressif.com>
Thu, 17 May 2018 11:12:45 +0000 (19:12 +0800)
committerAngus Gratton <gus@projectgus.com>
Thu, 17 May 2018 13:02:47 +0000 (21:02 +0800)
Cache effects on microbenchmarks in cached flash can be significant, depending on linker layout in flash.

components/idf_test/include/idf_performance.h
components/vfs/test/test_vfs_fd.c

index 40c733f03a8b403d13442b54fc3ad1de0505e7e0..f98f75c317887f08dc954b03413b01254fd5c1f0 100644 (file)
 #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
index a3c62365344418cfd330ed16e7000730d752f99e..c4292d3fca0d11befd1cc461940c6631ea939c4c 100644 (file)
@@ -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
+
 }