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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

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