[ Index | Introduction | Base | Recursion | Loops | Summary | RakuConf ]
Here is a summary of how long it took to compute the words, with different alphabet lengths, on my pc.
The actual time usage will differ substantially from pc to pc, but the overall trend should be the same.
Alphabet Size | Number of Words | Percent of Target | Run Time Base | Run Time Recursion | Run Time Loops |
1 | 3 | 0% | 0.3s | 0.6s | 0.8s |
2 | 650 | 0% | 0.5s | 1.1s | 1.3s |
3 | 25203 | 0.0002% | 6s | 30s | 9.2s |
4 | 325092 | 0.0036% | 1m 15s | 7m 10s | 2m 9s |
5 | 2347955 | 0.026% | 7m 10s | 10m 28s | |
6 | 11813838 | 0.1312% | 38m | 54m 22s | |
7 | 46374195 | 0.5152 | 2h 56m | 2h 41m | |
8 | 151820168 | 1.6868% | 6h 37m |
The recursive version is the most time consuming, and this should not really be a surprise.
But I had expected that the nested loops would have been faster than the Base
version, and they are not. The base
method clearly is fast, faster than
keeping track of 9 loops. Note that the Base version does not short circuit
the succession rule (i.e. skips illegal words en masse), whereas
the two others do. And it still is faster than the loops...
I'll fill in (some of) the missing values, when I get them. I have run out of time...
So, how many characters are needed in the custom alphabet?
I do not have an answer, other than the up front estimate of 13 or 14. But I will update the artcile, if I get the numbers...
[ Index | Introduction | Base | Recursion | Loops | Summary | RakuConf ]