Local storage stores data on the user's hard drive. It takes a little longer to read and write to the hard drive than in RAM.
The conclusion from this is that you can optimize your performance by reading local storage at startup and only writing it when the user logs out.
Now, whether this optimization will significantly affect your project, you have to figure it out, and as R3tep said, http://jsperf.com/ is a good solution.
My advice, however, is simply to go with optimization anyway, simply because it is less โsatisfying,โ I think the program would run slower than it could for no good reason.
Meredith
source share