Two weeks was all I needed
Unlike last year, the weeks leading up to Christmas were very quiet for me on the work front. From the 11th I had little of anything coming in from clients.
Disaster! It's Christmas, the most expensive time of the year. Fortunately I had already done most of my shopping, and had just the one Christmas party to go to (Twitfaced, it's always been you).
- The algorithm has two parts - a quick initial comparison of patterns, followed by a more in-depth, "exhaustive" search which feeds the results of the first stage back into itself. I had the first stage working fine, but the second stage was producing some odd results, and I couldn't figure out why, nor get enough run up at the problem to begin tackling it.
- The performance was, of course, pretty terrible. The original algorithm is written in C++ and is incredibly quick. I wanted to keep the performance as good as possible, as in-field time is expensive and precious.
Long story short, I now have the algorithm ported to JS and producing the same results as the original for known test matchings.
I'll be posting in the new year about my intentions for the port, as well as more about my experiences with Emscripten, but just now I wanted simply to share the message of the power of the luxury of a couple of weeks free from the demands of clients, money, and reality in general. I didn't lock myself away in a log cabin somewhere; I used the same office I do every day. It was just that freedom to experiment and work at a different pace that allowed me to quickly crack a nut I'd long been hammering away at.
Next year, I'm giving myself more weeks like that. And I think you should too. Merry Christmas, Happy New Year, and see all of you lovely people in 2015.