Michael Freiwald @freiwald.dev · May 21

It depends on how you create the relationship This picture is one of my slides about SwiftData where you can see three approaches. If you want to have more details about this, look at this article fatbobman.com/en/posts/rel... from @fatbobman.bsky.social

5 likes 2 replies

?

Replies

Florian · May 21

It seems that just defining inverse relationships (without actually using them during insertion) also slows down the insertion. After removing them and switching to contentsOf, the insertion time dropped to 1.9s. It seems like batching isn’t worth it, except for reducing memory consumption.

Florian · May 21

Vielen Dank 🫡