Skip to content

Store: we use a dictionary instead of an array #13

Answered by mergesort
lionel-alves asked this question in Q&A
Discussion options

You must be logged in to vote

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 a Set, but luckily the Swift Collections package pr…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@subdigital
Comment options

@mergesort
Comment options

@subdigital
Comment options

@lionel-alves
Comment options

Answer selected by lionel-alves
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