python - Which one is faster, eliminate a small number of duplicate items from a list or just run it directly? -


at current task. program generate unique list each customer, have 5-10 duplicated items in it, list length 40.

i need run program on millions of customers. i'm wondering 1 faster?

# plan customer_list = list(set(customer_list)) item in customer_list:     

#plan b item in customer_list:     

i use set completed customers. should work faster list.

completed_customer = set() item in customer_list:     if item not in completed_customer:        -do //add here item set: 

Comments

Popular posts from this blog

C# random value from dictionary and tuple -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -