Skip to content

Instantly share code, notes, and snippets.

View refs's full-sized avatar
🤖
Another pointless day where I accomplish nothing 🍸

Alex Unger refs

🤖
Another pointless day where I accomplish nothing 🍸
View GitHub Profile

Benchmarking in Go

Steps

go get golang.org/x/tools/cmd/benchcmp

write a benchmark for the function:

package main

Terms

Data Structures and variables

Literal

It is a value written exactly as it's meant to be interpreted. In contrast, a variable is a name that can represent different values during the execution of the program. And a constant is a name that represents the same value throughout a program. But a literal is not a name -- it is the value itself.

In the expression x = 3 x is a variable and 3 is the literal.

Haskell

Lists Comprehension

They are equivalent to set comprehension

Anatomy of a list comprehension: