title: What is the most efficient algorithm to find anagrams from a dictionary?
body: <p>I want to create a hash: keys will be first met different words, the value is a reference to anon array with anagrams of this key.</p>
  
  <p>I wrote the following code, which works when the amount of words is in range (0 to a few thousand) but I want to make it faster. </p>
  
  <p>Below is my way to check if a string is an anagram. I iterate for all words and for all keys of the hash.</p>
  
  <pre><code>join("", sort(split (//, fc($word)))) eq join("", sort(split (//, fc($key)))))
  </code></pre>