conf
conf copied to clipboard
Read data from disk once
Each read right now reads the data from the disk, which affects performance if conf is used in a high load application as the main storage. This change stores each write additionally in the state and on each use of the store it deep clones the state and returns it instead of reading from disk. Deep cloning is needed to prevent the mutation of the state variable and ensure conf fully behaves as previously. Speed improvements for reads is 100-500x, especially if encryption is used.