Coding Kata: Site Heartbeat in Elixir and Golang

Our today coding kata is a website heartbeat system. It checks the correct <title> for a bunch of domains. If a site is down, or the title is wrong, it should send a email. Of course it will do the job in parallel.

I’ll try it with Elixir and Go for fun and learning - and to have a bit of monitoring my sites.

Continue reading

Posted on

Parallel processing of CSV in Elixir and Golang

Our today coding kata is parallel processing of streamed CSV data from a file. I’ll try it with Elixir and Go for fun and learning.

TL;DR For Elixir, parallel_stream will win against Task.async and Poolboy for simplicity. In Golang it’s straightforward goroutines and sync.WaitGroup. Both runs fast and safe. And its a lot of fun.

Continue reading

Posted on

Benchmark Helloworld in Phoenix and Go

As a response of my update of “Benchmark Helloworld in different frameworks” yesterday, @chris_mccord gave me some hints on Twitter. So here we go.

Improvements:

  • using wrk instead of ab
  • log_level: :error + compile_time_purge_level: :error
  • disable CSRF while remove plug: protect_from_forgery
  • disable also plug :fetch_session and plug :fetch_flash (even we don’t use them on purpose for the test)
  • run more requests in sum to keep the machine busy long enough to see if the CPU usage is above 30% - thanks wrk support duration instead of requests
  • take the best of 3 runs
  • closing all other tools and apps

I’ll test (like before) on my MacBookPro 15” Mid 2010, 2,53 GHz i5, 8 GB DDR3, OS X El Capitan 10.11.2 and wrk 4.0.0.

TL;DR Go is still faster than Elixir. But remember .. apples and peaches.

[see also https://www.techempower.com/]

Continue reading

Posted on