Just testing upgrade from 5.5.2 to 10.7.6 and seeing a huge performance impact on queries

Hi we have just started testing the upgrade from 5.5.2 to 10.7.6 and are seeing a huge hit on query performance. Like 10x slower or perhaps even more. We are running local only at the moment.

Things that took one or two seconds are now taking minutes. They are quite complex queries but under 5.5.x they were always very fast.

Is there something significant that has changed with realm-core or realm-cocoa that could be causing this ? We’re running on macOS with Intel and Apple Silicon and the perform hit seems the same on both.

This is going to be a complete show stopper for moving to MongoDB Realm unless it can be resolved.

OK I just downloaded the prebuilt binary for RealmSwift 10.7.6 and performance is back to what we are used to seeing.

Anyone know if there is some Xcode / compiler setting one can use to ensure performance is good when debugging applications. I haven’t tested a production build using SPM to see if that improves performance.

I am just guessing now but could it be that in debug mode RealmSwift/Core perform poorly ?

Hi @Duncan_Groenewald – this doesn’t properly address your question, but I’ve switched over to using SPM for RealmSwift and it’s been working well for me (love being able to easily use a development branch when trying out new features).

Our app started with 3.x and have migrated through 5 and then on to 10.7.x - it’s macOS and our dataset is 2GB+. No SPM and we’ve not moved to M1 yet. Not used or needed to use the prebuilt binary either.

We are not seeing any real performance issues/differences from 5 to 7

Are you using indexedProperties?

I am not sure what a difference would be between a pre-built binary and building it in line with the app so that’s something that may be an issue. Do you have any other details or have some way to repo the issue?

Bear in mind the performance issue is only when running in DEBUG mode using SPM - when running in DEBUG mode with prebuilt binary no issues - same performance a Release Build.

There are no performance problems when building for Release using SPM. However we have some complex stuff that takes a few seconds to run to calculate a lot of statistics and when this is done with SPM in debug mode it takes a long time - maybe 30 seconds (up from less than 2 seconds).

It would be nice to be able to use SPM and avoid any DEBUG overhead - since we are not debugging RealmSwift.

No big deal since we are just using the prebuilt binaries.

@Andrew_Morgan - thanks please note that the performance hit is ONLY when running in DEBUG mode but it is pretty severe if testing with a lot of data. Other than that SPM is great - but the prebuilt binary works fine and means we don’t have performance problems in DEBUG model.