Advantages GO 1.9?


#1

Hello everybody,

Just a simple question :
What are the advantages for Hugo of going to go in 1.9 ?
Are we still winning in build time ? (is it possible ? :slight_smile: )

Thanks


#2

In my benchmarks Go 1.8.3 vs Go 1.9, Go 1.9 in Hugo is maybe a couple of per cent faster (not statistically significant), but there are some other potential future gains:

  • Go 1.9 adds a sync.Map that that may make our cache constructs faster (we use sync.RWMutex), but probably not very significant and we need to do a job there
  • Go 1.9 has done lots of work on optimizing the strings/byte handling to add quick paths for pure ascii text etc. (and they continue to do so; they did some counting inside of Google where strings.ToLower was in the of the top 5 in use and in 90% of the cases there was no Unicode involved), and I guess they are continuing that work in Go 1.10. This is probably one of the areas in Hugo where we can possibly do better.

See here https://blog.golang.org/go1.9

There are other pluses for Hugo there, too, as faster builds, smaller binaries, new test helper …

As an added note: People tend to believe that Hugo’s speed comes from Go alone. It is easy to write slow software, even in Go …


#3

You are right. These are clearly earnings of the developers. The same how you can make a website slow even if it’s HTML5 and CSS3. I’m very happy that you and the other folks developed Hugo and keep doing so.