Skip to content

A way to retrieve a specific value without ctor overhead #2773

Answered by fealebenpae
peppy asked this question in Q&A
Discussion options

You must be logged in to vote

There isn't a way to do this more efficiently, I'm afraid. I have had the idea of allowing realm models to be value types, which should help reduce GC overhead, but there would still be the matter of performing the P/Invoke calls to get the Cat and NameTag handles.

I think in this case supporting something like realm.All<Cat>().Select(c => c.NameTag.Name).ToList() would be ideal, and it'd be worth looking into what the Swift SDK did for the Projections feature they released recently.

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@peppy
Comment options

@peppy
Comment options

@nirinchev
Comment options

@peppy
Comment options

@nirinchev
Comment options

Answer selected by peppy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants