Store: we use a dictionary instead of an array #13
-
I have been using Codable for easy persistance for a while, I really like what you have done here! I was wondering if you considered using a dictionary instead of an array in the I guess the best would be to be able to choose the data structure depending of the use case. A |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey @lionel-alves, first off thanks for the kind words. Your suggestion is great, I've actually been thinking about doing pretty much exactly this in fact, with only a very small difference! I wanted to release Boutique before doing this knowing this is an optimization that wouldn't be exposed to users, so it wouldn't be an API breaking change. I also don't expect it to be a huge performance problem initially, you would only start seeing benefits when users start using it with some scale, especially given how optimized Now for the small difference. Maintaining order is important so that rules out using a How does that sound to you? 🙂 |
Beta Was this translation helpful? Give feedback.
Hey @lionel-alves, first off thanks for the kind words. Your suggestion is great, I've actually been thinking about doing pretty much exactly this in fact, with only a very small difference! I wanted to release Boutique before doing this knowing this is an optimization that wouldn't be exposed to users, so it wouldn't be an API breaking change. I also don't expect it to be a huge performance problem initially, you would only start seeing benefits when users start using it with some scale, especially given how optimized
Array
is in Swift.Now for the small difference. Maintaining order is important so that rules out using a
Dictionary
and aSet
, but luckily the Swift Collections package pr…