realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

Benchmark opening and closing a Realm

Open cmelchior opened this issue 2 years ago • 0 comments

Opening a Realm currently does quite a lot of things that we know can be "slow", especially around schema parsing. We should benchmark how this scales to see if there are any bottlenecks.

The hypothesis is that we should scale linearly with the number of model classes and properties. Which could be tested by something like this:

  • Opening a Realm with no schema
  • Opening a Realm with a "small" schema, say 5 model classes
  • Opening a Realm with a "medium" schema, say 20 model classes
  • Opening a Realm with a "large" schema, say 100 model classes
  • Each of these should be done with 5, 20 and 100 properties to see if the number of classes or properties are the biggest factor. We should also check if "advanced" properties like Collections have a bigger overhead than primitive properties. The assumption is yes since we need to resolve more type information, but would be interesting to see how much. We could do this by just having all the properties in a class be collections vs. one where they're are all primitive types.

cmelchior avatar Sep 14 '23 11:09 cmelchior