Issue 1:
Issue Details

Electron Version:

9.1.0

Operating System:

macOS 10.14

Last Known Working Electron version:

Maybe Electron <= v7, although maybe I wasn't using localStorage at all back then 🤔

Expected Behavior

LocalStorage shouldn't be absurdly slow.

Actual Behavior

LocalStorage is absurdly slow, requiring about 5 seconds on my machine for this call:

localStorage.getItem('');

To Reproduce

This is a weird one, I spent a couple of hours tracking down this one, you might be able to reproduce it with the files provided but I'm not sure.

Running npx electron app_dummy_slow.asar requires about 5 seconds on my machine for a window to show up.

No need really to unpack the asar, it's essentially the quick-start project with only 2 interesting lines, without either of which I can't reproduce the issue:

localStorage.getItem('');

Putting this call somewhere in index.html takes about 5 seconds to complete, which sounds absurd to me. Without this call I can't experience any issues.

The same thing happens when using sessionStorage.

"name": "notable",

This is in the package.json file, using a different name I can't reproduce the issue. As "notable" is the name of my Electron app I guess when setting this name its specific local storage and session storage files are getting loaded, which for whatever reason takes forever.

The "Local Storage" and "Session Storage" folders, attached below, found under "~/Library/Application Support/Notable", weigh like less than 50kb each, making this even weirder.

Somewhat surprisingly Notable's appData folder weighs about 20MB on my machine, while the analogous folders for other electron apps on my machine weigh about 500kb each, but its content seems ok to me:

Resources

app_dummy_slow.asar.zip

Session Storage.zip

Local Storage.zip

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

8.0.0

Operating System:

Windows 10

Expected Behavior

Fast startup for multiple application instances and localStorage is synchronized.

Actual Behavior

Slow startup for multiple application instances and localStorage is not synchronized.

To Reproduce

Save something into localStorage that will be retrieved on application startup.

Now open a second instance of the application.

Additional Information

⚠️ The issue can be closed. This is just an information for everyone stumbling across the same problem. Hopefully it will appear in search engines.

The problem is that the application locks the config files associated with localStorage. When an additional instance starts it will eventually timeout requesting the same lock. The timeout will slow down the application startup by quite a bit.

A workaround is not to use localStorage. For my application I'm using https://github.com/nathanbuchar/electron-settings. This library works great and as far as I can tell there are no locks on the config files. To synchronize settings use a file watcher (also in that library) that notifies file changes.