conf icon indicating copy to clipboard operation
conf copied to clipboard

Read data from disk once

Open fablee1 opened this issue 1 year ago • 0 comments

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.

fablee1 avatar Sep 07 '23 15:09 fablee1