Slides – Talk 05/11/2017 – Performance Profiling

I gave a talk about performance profiling in golang, the 5th November in Paris, at La paillasse, organized by the Golang Paris meetup. I really like performance subjects in Golang, as you may have seen in some previous publications. Slides (link) :

Thomas Solignac Entrepreneur – Cofounder at Golem.ai (Paris, France) I enjoy sharing Golang interesting patterns, experiments and tips.…
Read more

2 tricky behaviors of “defer”

When discovering Golang, “defer” seems at first a little exotic.
Here is 2 situations with no obvious behavior. …

Function calling a function in defer

If you want to time a function, at first sight, that may be a good idea to do :
package main
 
import (
	"fmt"
	"time"
)
 
func main() {
	start := time.Now()
	defer fmt.Println(time.Since(start))
 
	time.Sleep(100 * time.Millisecond)
}
and… wrong.…
Read more

Add Websocket to your TCP service with minimal changes

Offer your users the possibility to connect by websocket ! It allows them to use your service from javascript code : * Javascript is very popular and lets you build prototypes very quickly
* It’s more easy to build a GUI with HTML than most desktop languages
* You can offer a true demonstration of your service directly on your website and… let me convince you that it’s very low-cost.…
Read more

Network proxy in 20 lines

Authentication, load balancing… You need a proxy ? Let’s do it in an idiomatic way.
It’s surprisingly easy ! …

Needs

We need to handle 2 connections : the User and the Server. Story :
1- The User connects to the Proxy
2- The Proxy connects to the Server
3- The Proxy sent messages from the Client to the Server, and from the Server to the Client (transparently) We don’t speak about the specific treatment of the proxy (authentication, load balancing …) you wish to do.…
Read more