Fosdem 2023 notes
:fosdem: :konferencija:
Finally Fosdem is live again! Unfortunately there was no direct flight from Vilnius, since Brussels Airlines have stopped direct flights until spring. Anyway, Fosdem was great this year!
Building a CI pipeline with Dagger in Go
Personal score: 2/5, URL
Speaker did a short intro what Dagger is and then tried to launch demo for 20 mins but failed. I’ve got the main idea what Dagger actually is but nothing special from this talk.
- Dagger allows to write pipelines in any language (Golang in this case was an example).
- From examples these pipelines are mostly creating Docker containers and running them.
- Pipelines can run anywhere (including locally which is good thing).
- SDK is GraphQL API hence a client can be created for any language.
- Magefile - library to implement Makefile-like files in Golang.
Debugging concurrency programs in Go
Personal score: 4/5, URL
- Debugging can be done via
fmt.Print
,dlv
,strace
. - Use different colours for output from different goroutines.
- Print scheduling events
GODEBUG=schedtrace=5000 <binary>
. dlv
- add breakpoints. Sending data to chan does not work yet.- Use
pprof.Labels
and thenpprof.Do(ctx, labels, func() ...)
(dlv) goroutines -l
will list goroutines.(dlv) goroutines -l -with label page=/about
- list routines with label.- Deadlocks happen and are difficult to debug. Golang captures deadlocks when whole application stops working but not when separate parts are locked (e.g. few goroutines out of multiple).
- Use conditional breakpoints!
What’s new in Delve / Tracing Go programs with eBPF
Personal score: 4/5, URL
- Delve is released once Golang RC for new version is released. Hence
dlv
is compatible with new versions of Golang. - Can generate coredumps for running process.
- Added support for hardware watchpoints.
- Goroutines: support for filtering & grouping.
- Experimental eBPF support:
ptrace
is slow because of multiple context switch operations. Usually context switch is executed at least 2 times for one function. Solution is eBPF.- eBPF programs are triggered by events. Those run in kernel so context switch is not required.
- Written in C.
Go Even Further Without Wires
Personal score: 3/5, URL
- Not much personal value for myself but fun to listen. Great speaker!
- LoRa support is now available on TinyGO.
Optimizing string usage in Go programs
Personal score: 4/5
- Strings are used everywhere and can consume huge amount of memory. Imagine amount of labels used in Prometheus.
- Implemented as struct under the hood with pointer to data and length. So the string always brings 16 bytes of overhead due to header.
- ^This made me underhand why “Stringer” (the generator) adds all constant names to a single string and keeps integer indexes.
- Strings are immutable. Copying creates a shallow copy, but adds new header (and overhead). Multiple copies leads to multiple headers.
- String interning can help: keep repeated strings in
map[string]string
and reuse those. Requires to delete unused strings manually because GC won’t release memory. - Constants can be used as keys so strings stored in
map[int]string
. This also reduces network traffic sinceint
is sent instead ofstring
.
Squeezing a go function
Personal score: 3/5, URL
- Optimizing not necessary means less allocations, etc. Author gave great examples when more allocations led to faster code and vice versa.
- Measure everything, run benchmarks, do not guess.
- Add
b.ReportAllocs()
to print memory allocations in the benchmark (!!!). - Struct alignment.
Profiling:
$ go test -bench . -memprofile memprofile.out
$ go tool pprof -text memprofile.out
...
$ go tool pprof -svg memprofile.out
Generating report in profile001.svg
...
# List specific function from profile file.
$ go tool pprof -list os.newFile memprofile.out
Same with CPU profile:
$ go test -bench . -cpuprofile cpuprofile.out
Neovim and rust-analyzer are best friends
Personal score: 2/5, URL
As I understood the talk supposed to be longer but was cut because of some reasons which are unknown to me. So it was just short history of Neovim, few plugins and native LSP support.
Passwordless Linux – where are we?
Personal score: 1/5, URL
Not my field. Can’t rate without bias. Was quite boring. Might be because I’ve got 9.6% ABV beer instead of ~6% and drank 1.5 bottles :|
Winners and Losers in FOSS
Personal score: 4/5, URL
Great talk (and research) on state of FOSS.
- FOSS does not compete with proprietary software anymore.
- Most open source contributors work for corporations which dictate direction of the software.
- FOSS job is unsafe - Google & Twitter just laid off bunch of OSS developers.
The PolyVent FLOSS Ventilator
Personal score: 3/5, URL
Nice story about open source ventilator which was developed & created for COVID treatment. Tool is modular so each component can be replaced easily or additional components can be added. Also access to components is easy.
Controlling the web with a PS5 controller
Personal score: 3/5, URL
- JavaScript now supports USB devices.
- Introduction to WebHID API. Demo how to pair a device and make it to control something on web.
Application Monitoring with Grafana and OpenTelemetry
Personal score: 3/5, URL
- Grafana demo. Demonstrated how metrics, logs and traces looks like in Grafana.
- Though examples were simple - it is good to see what Grafana is currently capable of.
Practical introduction to OpenTelemetry tracing
Personal score: 3/5, URL
- Autoinstrumentation is only possible when runtime exists (e.g. JVM)
- Entrypoint is responsible for generating tracing id.
- Expected deeper topic, but it was just a demonstration how to do tracing in different languages and which libraries are available.
Exploring the power of OpenTelemetry on Kubernetes
Personal score: 1/5, URL