Which one is faster between map, collect, select and pluck?

Viewed 11071

I have been using different methods to get specific fields from active record, But which one is faster and preferred to use and how are they different from one another?

User.all.collect(&:name)
User.all.pluck(:name)
User.all.select(:name)
User.all.map(&:name)

Thanks for your help in advance.

2 Answers
Related