Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-489

Performance - Overhead of using Realm objects

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      Currently, using Realm in a scenario which require a lot of calls through the C++/JS boundary (i.e. in a tight loop), can totally kill the performance of an app.

      We did some tests and for example, just accessing something like

      results[0].myprop

      was >200x slower with Realm objects than normal JS array of objects (which you'd get after running a query on other databases).

      Some possible solutions:

      • Graal.js in theory could help with that, but it seems that node extensions are not optimized at this point
      • Automatic caching of retrieved data (datomic does something similar)
      • Using something like JSON.parse(JSON.stringify(results)) instead of realm collections and objects - slow and ugly, last-resort hack

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: