marcuswestin / store.js

Cross-browser storage for all use cases, used across the web.
MIT License
14.02k stars 1.33k forks source link

Performance issue on Safari/iOS iPad 3 #41

Closed JpEncausse closed 12 years ago

JpEncausse commented 12 years ago

It seems the initialisation of the store is really slow on Safari/iOS

How to reproduce:

=> On Chrome, the page is "instant" I only see a little flicks => On iPad3 / Safari, I have to wait 4 seconds until the page is updated => Next get/set are fast

According to this article (http://hacks.mozilla.org/2012/03/there-is-no-simple-solution-for-local-storage/) local storage is slow but I didn't think so much ??

marcuswestin commented 12 years ago

Hi @JpEncausse - was this not an issue with store.js? Either way I'd be curious to hear what was going on :)

Cheers! Marcus

JpEncausse commented 12 years ago

Well it is really weird, on iOS (Safari/iPad3) if I run a JS code that update the DOM (not an alert) after DOM Load (on defer()) it seems the app waits few seconds to do the job.

I think the defer() => PrototypeJS on DOM Load is delayed by MobileSafari may be to handle the appcache job. And it's really faster on Chrome.

The workaround is to the job straight forward (no defer). There is no issue with store.js

marcuswestin commented 12 years ago

Very interesting! Thanks for sharing man.

Cheers! Marcus

On Thu, Apr 12, 2012 at 2:30 PM, Jean-Philippe Encausse < reply@reply.github.com

wrote:

Well it is really weird, on iOS (Safari/iPad3) if I run a JS code that update the DOM (not an alert) after DOM Load (on defer()) it seems the app waits few seconds to do the job.

I think the defer() => PrototypeJS on DOM Load is delayed by MobileSafari may be to handle the appcache job. And it's really faster on Chrome.

The workaround is to the job straight forward (no defer). There is no issue with store.js


Reply to this email directly or view it on GitHub: https://github.com/marcuswestin/store.js/issues/41#issuecomment-5101170

My code http://github.com/marcuswestin My latest http://twitter.com/marcuswestin