electron-json-storage icon indicating copy to clipboard operation
electron-json-storage copied to clipboard

.getAll is kinda slow. how can I speed it up?

Open MarlonCopeland opened this issue 7 years ago • 1 comments

I set my path to be a separate folder that will only hold my app's json values. But when trying to pull all the values (which is only 1) it takes like 5 seconds.. can you help me speed this up?

MarlonCopeland avatar Sep 20 '18 16:09 MarlonCopeland

Hey @MarlonCopeland ,

That's very weird! What OS are you running this on? Do you have a small reproducible example I can try from my side? This module uses fs under the hood, which should be very fast. The only reason for the slow down that I can think of is that electron-json-storage might be retrying multiple times to obtain the lock. Maybe try attaching a debugger, stepping through the code, and see if you hit the retry logic from the lockfile module (a dependency of electron-json-storage)?

Let me know what you found. I might be able to help more given more info!

jviotti avatar Oct 01 '18 10:10 jviotti