Phone number to words based on the dictionary
I would first start by doing some basic profiling of your application to see where the issues are. This could be as simple as inserting console.log( (new Date()).valueOf() ) in a few places.

Some things I noticed.


Is your dictionary file sorted? If not then sort it first. Either way use bsearch to locate entries rather han using &amp; which is very naive.
It looks like you are trying every combination of letters but you probably want to use an algorithm that stops if there is no match. For example given 668, if your dictionary contains no entries starting with mn (66) then there is no point in checking mnt, mnu, mnv` or any of the longer combinations.
Try to reduce the number of times you copy and modify arrays ([a..b] or shift)
This check: next if first_array.length &lt; 3 || second_array.length &lt; 3 could go before you copy the array (in a slightly modified form). You could just change for i in (2..total_number) to for i in (4..total_number-2)