I often have anywhere from 18 to 24 students in my class. To help learn their names quickly, I ask them quietly and individually what their last name is and what they PREFER to be called. I often hear nicknames/preferred middle names/short names that other teachers never know about! I also ask them to pronounce their name several times if it is difficult for me, and I tell them, "PLEASE let me know if I am saying your name wrong at any time during this course".
Now, while I am doing this, the class is engaged - usually with a "Student Information Sheet" assignment. In this computer-based assignment, I have them type in their name, preferred name, contact information, and answers to several key questions. These include "Class starts on time. Please state here any reason that you might be late or have to leave early". Another one is "your favorite school memory" I have the complete list if anyone wants to see it.
Erla (I go by my middle name)