Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 GO


  In-memory key-value store in C, Go and Python

Subtitle: Wow Go’s net library is fastOn paternity leave for my second child, I found myself writing an in-memory hashmap (a poor-man’s memcached), in Go, Python and C. I was wondering how hard it would be to replace memcached, if we wanted to do something unusual with our key-value store. I also wanted to compare the languages, and, well, I get bored easily!The code is on github as Key-Value-Polyglot.Each version implements enough of the get and set commands from the memcached protocol that we can test them with a memcached client.If you write a version in a different language (...

4,429 0       KEY-VALUE MEMORY C PYTHON GO


  How the Go language improves expressiveness without sacrificing runtime performance

This week there was a discussion on the golang-nuts mailing list about an idiomatic way to update a slice of structs. For example, consider this struct representing a set of counters. type E struct { A, B, C, D int}var e = make([]E, 1000)Updating these counters may take the form for i := range e { e[i].A += 1 e[i].B += 2 e[i].C += 3 e[i].D += 4}Which is good idiomatic Go code. It's pretty fast too BenchmarkManual 500000 4642 ns/opHowever there is a problem with this example. Each access the ith element of e requires the compiler to insert an...

2,088 0       GO EXPRESSIVENESS PERFORMACE SACRIFICE


  Go vs C benchmark. Could Go be faster than C?

During last semester I was attending Multiprocessor Architectures course, given at Facultad de Informática where I study my Computer Science degree.As part of the assignments due to pass the course, we had to do several programs written in C to benchmark matrix multiplication by testing different techniques and technologies. First of all we had to do a secuential program in three different versions:A normal one where the result matrix is ordered by rows and the loops range the matrix by rows tooAn “inter” version where the result matrix is ordered by rows but the loops range the...

4,105 0       COMPARISON C SPEED GP BENCHMARK FASTER


  Learning Go

This year I'm going to try a new programming language - Go. I had this notion that compiled, type based languages are overly complex and reduces developer efficiency. However, after doing some reading about Go, it appeared to take a different path from the rest and felt like something worth trying.Acquainting a programming language is a journey. First few steps you take with it will define your perception about it. These first few steps went well for me with Go and it felt like a good fit for my repertoire. I thought of sharing my learning experience, hoping it will help others who w...

2,259 0       GOOGLE LEARNING GO RESOURCE