From Sinatra/Ruby to Martini/Go  

Just spent a day to migrate from Sinatra/Ruby to Martini/Golang.

The urgent for me to do this is because the node I have is Linode 2G. I found that by using two Sinatra app with alexch/rerun, it consume almost 200mb in background.

That’s not good.

Recently I start to play with data in Aozora and create one search engine based on TF-IDF to the novels. I choose Martini because it has similar syntax with Sinatra.

And I happen to find that, it take so little memory in background.

Normally I don’t care about the memory usage. But during data preparation for tf-idf, the app is always killed by system due to short of memory.

Because I need to generate data from 280000+ words with 13000+ novels. The data structure it created cannot be fit into my little web node. I choose to generate the data in my MBPR and try to save into mongodb.

And even the data saving is time-consuming. So it tells me that I should try to reduce the background memory usage. So I do it today.

I must admit that I thought I need more time. But it turns out that dealing with template(.tmpl) and mgo is not that difficult. Because I already have some experience. And I do remove some less used features.

The experience is quite good that I think I can start to continue to replace other feature written in previous app.

 
25
Kudos
 
25
Kudos

Now read this

Good tools

I decide to take the challenge, 通訳案內士試験, which the first exam will take place in the end of August. There’s many thing need to study and the time left little to me. But I still want to enjoy the study and want to use some tool I know to... Continue →