optimize getNames() by pre-sorting the names and use loop with vector instead of dictionary

Hi, 

We have a performance issue with loading textures on our mobile app so we try to optimize some stuff. In this patch, we avoid to loop within the Dictionary and sort in getNames.

Thanks,