Loading config values and performance, flash wear


I’m having no trouble loading config settings from my mos.yml file, but after looking at the source code for how it works I’m still wondering about a performance issue. Is it better to load the values once and copy them into my own data structure once, say at startup? Or is it okay to load them using the mongoose generated functions each time the configuration data is needed.

I ask because I’m concerned about (1) performance of the read from flash vs memory and (2) wear on the flash from frequent reads.

Of course, if Mongoose copies the data into a data structure when the user updates the data then repeated reads should be fine, but I’m not sure if this is the case.


Flash will not wear on reading. FRAM does wear out with reading, flash does not.
Flash wears out on erasing, but iirc there is a wear leveling layer between your calls and the flash hardware, so you shouldn’t worry about that unless you plan to write big data very frequently.


Thanks @scaprile, I’m not planning many writes, just many reads.