Get taxonomy name in cycle (performance)
You can use custom query like next:

$result = db_select('taxonomy_term_data', 't')
  -&gt;fields('t', array('tid', 'name'))
  -&gt;condition('t.tid', $tids, 'IN')
  -&gt;execute()-&gt;fetchAllKeyed();


Or you can do join with entity table for single query.