Skip to content

best data structure for a specific use case (microstream performance question) #673

Answered by hg-ms
guykatz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
If you don’t need to maximize performance id suggest using a map if the api better fits your needs.
If performance matters using a simple list writes less data on a store. Here is why:
If you store a list, a long value for each entry in the list (the entries internal ObjectID) and all entries that are not jet persisted are written. In case of a map the keys need to be stored too in the same manner as the values.
In case of 300 entries this would be 2400 bytes + newObjects for a list and 4800 bytes + new Objects in case of a map.

One optimization you may do is combining the removing and adding in one store.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@useryq8
Comment options

@hg-ms
Comment options

hg-ms Nov 7, 2023
Collaborator

Answer selected by guykatz
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