Skip to content

Commit 6682da1

Browse files
committed
nvm_flash_log: add performance consideration in header
1 parent a19079c commit 6682da1

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/wh_nvm_flash_log.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@
4242
* Flash backend:
4343
* This layer relies on the same flash backend as wh_Flash, using the whFlashCb
4444
* interface.
45+
*
46+
* Limitations and performance considerations:
47+
*
48+
* The implementation favors simplicity over both speed and space.
49+
*
50+
* Regarding space:
51+
* - An area of RAM as big as one partition is allocated to cache the
52+
* partition.
53+
*
54+
* Regarding speed:
55+
* - Each updates to the NVM (create, write, delete) requires copying all the
56+
* objects from one partition of the flash to the other + erase operations.
57+
*
58+
* Possible future improvements:
59+
*
60+
* - cache only the metadata in RAM, access data on the FLASH as needed
61+
* - use a true append log format to avoid copying all objects on each update
62+
*
63+
* Right now the implementation works well for read-heavy workloads with few
64+
* updates.
65+
*
66+
* Alignment consideration:
67+
*
68+
* The implementation assure that writes are aligned to WRITE_GRANULARITY in FLASH memory space.
69+
* The source data passed on the flash layer might not be aligned.
4570
*/
4671

4772
#include "wolfhsm/wh_settings.h"

0 commit comments

Comments
 (0)