There was a recent post about anagrams and the author just put all the letters in alphabetical order and then compared the words, which was more efficient than generating permutations.
We had about 300 hits/day so it didn't matter.
https://github.com/Rhebel/DailyProgrammer/blob/master/DailyP...
I know my code is super verbose compared to other people's but I'd rather be understood than clever.