Speed up conda installs with mamba

Conda and Mamba

Conda is an open-source package manager mainly used for managing Python environments.

Historically, installing and updating packages in conda environments was slow and tedious. This motivated QuantStack to create Mamba, a faster drop-in replacement solver for conda.

In December 2022, the conda project included mamba as a default solver, after 9 months in "experimental" status. This is great news for all conda users, however, mamba has to be manually installed and activated.

Here are 3 different ways to install mamba ...more

2 min | 03 January 2023 | [Python] #anaconda #conda #mamba

Efficient ASCII bitset in Go

Whenever we want to check a string for prohibited ASCII characters, such as in username validation, a simple method is to use a set of ASCII characters.

While other languages like Python and JavaScript have built-in sets, Go does not.

Instead, the natural way to implement sets in Go is to use the built-in map. With Go map, sets of any comparable variable type can be created.

import "fmt"

set := make(map[byte]struct{})

set[42] = struct{}{}

_, exists := set[42]
fmt.Println(exists) // expect: true

_, exists := set[99]
fmt.Println(exists) // expect: false

However, for sets of ASCII characters, the Go source code offers a faster solution, the asciiSet.

In this blog post, we shall build ASCIISet, an extension of asciiSet from the Go source code, from scratch. Afterwards, we shall compare its performance against traditional map based sets. ...more

10 min | 31 December 2022 | [Go] #Go #data #structures #bitset #rune