I am recruiting!

Archives

Boring stuff

Quantifying the performance benefits of Go 1.9 on bitsets

Go, the programming language initiated at Google, has recently shipped its version 1.9. One big change is the introduction of the math/bits package which offers hardware-accelerated functions to manipulate data.

Again, pretty much the same story, almost doubling the performance. The benchmark and the test machines are different, so we cannot compare the relative gains, but the gains are enormous, that much is clear!

Whether this matters in any given application is hard to tell, but take into account that these performance gains are basically “for free”. It is the difference between using the dedicated silicon on your chip, or doing something twice as complicated instead.

This is great, but Go is still missing some key intrinsics. One particular annoyance is that most 64-bit processors today can cheaply compute the most significant 64 bits of the multiplication between two 64-bit integers. In the case of x64 processors, this computation is literally free most of the time. Yet there is no way to access this, and you are stuck doing something much slower instead, just because of the limitations of the language.

Don’t get me started with SIMD instructions: there is no good way to write vectorized algorithms in Go.

Daniel Lemire

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

This will be displayed in a monospaced font. The first four
spaces will be stripped off, but all other whitespace
will be preserved.
Markdown is turned off in code blocks:
[This is not a link](http://example.com)