Code Monkey home page Code Monkey logo

Comments (4)

kyle-ssg avatar kyle-ssg commented on May 12, 2024

Updated results, the tests were a bit unfair initially in that I wasn't JSON.parsing the results from AsyncStorage.

MMKV
Set: 31ms
Get: 25ms

Async Storage
Set: 17ms
Get: 13ms

from react-native-mmkv-storage.

kyle-ssg avatar kyle-ssg commented on May 12, 2024

Some even more interesting results, if I always do a set/getString rather than object, things get a lot faster and indeed MMKV is faster than AsyncStorage..

MMKV String
Set: 16ms
Get: 11ms

Async Storage
Set: 17ms
Get: 13ms

I think if this is unavoidable it's definitely worth noting that setString with a JSON.stringify/parse can be significantly faster than set/getObject.

Also I'd want to ask the question, is there even a usecase for object storage if it's slower than JSON.parse/stringify? I'm only guessing here but I bet the latency is just it reconverting the string back to an object in native code.

from react-native-mmkv-storage.

ammarahm-ed avatar ammarahm-ed commented on May 12, 2024

You are probably right, well this will change once Fabric comes out next year and then it might be useful. @kyle-ssg

from react-native-mmkv-storage.

kyle-ssg avatar kyle-ssg commented on May 12, 2024

Oh cool! Good to know @ammarahm-ed

from react-native-mmkv-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.