-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: 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