Python -> Go

Porting FIND to Golang for future development



I’ve rewritten FIND in Go because the server is a bit faster (see below), but the real reason is that it saves me $$ because I can run it on the cheapest Digital Ocean (DO) droplet. I run the FIND server on a droplet with along with a half dozen other services.

I only have about 20% of a 500MB of memory to use on my DO machine. I’ve never been able to write a Python server than can use less then 100MB, so by writing it in Golang it can run pretty easily on cheapest DO!

Abandoned, but not forgotten

My contributions to this project were stalled out around December, 2015. I was far from done working on FIND though. Instead I began teaching myself Golang in order to rewrite FIND to be faster, and also have a smaller memory footprint. However, if you looked at my Github commits you would have seen quite an empty graph.

Better, stronger, faster.

The git commit history actually does not show previous versions of FIND before I knew about source control. The first iteration was written in PHP! Then it was written in Python using Flask, and Tornado. However, each time it was rewritten it got a little bit better.

This time took several months, but I finally got it working well in Golang. The speedup results are very promising:

Version Fingerprints sent to /learn Optimizing priors through /calculate
Python 15 fingerprints/sec 3 calculations/min
Go 76 fingerprints/sec 619 calculations/min

There is still a lot of features I’d like to implement, but I will start working more closely with version control so my work is more transparent.

 
comments powered by Disqus