Hi
I will have alot of similar objects with similar parameters. Example of an object parameters would be something like :
name, boolean, number and list.
The name must be unique value among all the objects while values for boolean, number and list parameters must not.
I could store the data as list of dictionaries i guess. Like that:
list = [
{'name':'a', 'bool':true, 'number':123, 'list':[1, 2, 3]},
{'name':'b', 'bool':false, 'number':143, 'list':[1, 3, 5]},
{'name':'c', 'bool':false, 'number':123, 'list':[1, 4, 5, 18]},
]
What would be the fastest way to check if the unique name exists in the list of dictionaries, before i create another dictionary in that list? Do i have to loop through the list and check what is the value of list[i][name]? What would be fastest and least memory conserving to hold and process that information, assuming, that different similar lists might be simultanously processed in different threads/tasks and that their size could be anywhere between 100 to 100 000 dictionaries per list. Should i store those lists in database instead of memory?
I understand that perhaps i should not be thinking about optimizing (storing the info and threads) before the project is working, so please, answer the unique name lookup question first :)
Thanks, Alan