---
title: "'Cgo performance is good actually'"
publication: "Go Weekly"
issue: 474
published_at: "2023-09-05"
canonical_url: "https://golangweekly.com/issues/474"
---

Plus how Go 1.21 enables truly reproducible builds. |        

#​474 — September 5, 2023 

[Unsub](https://golangweekly.com/leave/*|UID|*)|[Web Version](https://golangweekly.com/issues/474)  

Together with [![Teleport logo\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_280,h_60/e_make_transparent/co_white,e_outline:5/vr8quyt0q3vtxkpueewu.png)](https://goteleport.com/kubernetes-access/?utm_campaign=0905Cooperpress&utm_medium=partner&utm_source=golang)  

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/mfiqd2mgkplrs4mzsjtq.jpg)](https://go.dev/blog/rebuild)  

[Perfectly Reproducible, Verified Go Toolchains](https://go.dev/blog/rebuild) — Go 1.21 contains some [significant features](https://tip.golang.org/doc/go1.21), but truly reproducible builds is a big deal and Russ goes (deep) into how it works here, complete with a walkthrough. The Go team has also built a tool, [gorebuild](https://pkg.go.dev/golang.org/x/build/cmd/gorebuild), to _prove_ the feature works as intended. 

Russ Cox   

[Cgo Performance in Go 1.21](https://shane.ai/posts/cgo-performance-in-go1.21/) — [Cgo](https://go.dev/blog/cgo) makes it possible for Go packages to call C code and is commonly used to provide Go apps with access to the larger world of C-based libraries. Shane doesn’t want to argue about Cgo's pros and cons here but _does_ make the case that its performance is good and the overhead is insignificant in most cases. 

Shane Hansen   [![\](https://copm.s3.amazonaws.com/b420082e.png)](https://goteleport.com/kubernetes-access/?utm_campaign=0905Cooperpress&utm_medium=partner&utm_source=golang) 

[Certificate-Based MFA, RBAC, and SSO with Teleport](https://goteleport.com/kubernetes-access/?utm_campaign=0905Cooperpress&utm_medium=partner&utm_source=golang) — Implement industry best practices for Kubernetes access with minimal configuration. Easily enforce MFA, RBAC, and SSO using identity-based short-lived X.509 certificates for engineers and service accounts by starting your trial today. 

Teleport | goteleport․com sponsor   

[A Closer Look at Go's Profile-Guided Optimization (PGO)](https://theyahya.com/posts/go-pgo/) — PGO offers compile-time optimization of binaries based on profile data of actual usage, which can genuinely change the performance characteristics. This is something you need to get into your build pipelines. 

Yahya SayadArbabi   

_QUICK BITS:_ 

- 🎤 Carl Johnson went on the _Go Time_ podcast to talk about [▶️ what's new in Go 1.21](https://changelog.com/gotime/289).
- ✨ The [official Go tour](https://go.dev/tour/welcome/1) now has _dark mode_ support - though you do have to toggle it manually.
- Over on Twitter, Cloudflare's Matt Boyle explains [🐦 why `errgroup` is his favorite Go package.](https://twitter.com/MattJamesBoyle/status/1696074301256904943) They make it _"really easy to take a bunch of tasks and run them in parallel, making your program faster."_
- 📗 In other Matt Boyle news, he's turning his useful Twitter threads about Go into [an ebook called _x Days of Go_](https://leanpub.com/days-of-go) ('x' is yet to be decided). You can grab it for free or pay up to $20 if you like the cut of his jib.
- ⚖️ The Go team has published an official set of [brand and trademark usage guidelines](https://go.dev/brand) for the term 'Go' and the official Go logo.
- Ever wanted to [▶️ watch Russ Cox coding live?](https://www.youtube.com/channel/UC3P6PrEBAVH1UaiPOzZ-u-w)   

[Using Go to Write User Defined Functions (UDFs)](https://www.splitgraph.com/blog/seafowl-udf-golang) — Less a tutorial and more an interesting example of how [Seafowl](https://seafowl.io/), a Rust-powered analytics database, supports user defined functions provided as WebAssembly and how Go can be used to create such functions. Go's ever improving WebAssembly support will open up more use cases like this over time. 

Patrick Skinner   

[Automated Cloud Provisioning from Your Go Code](https://encore.dev/docs/introduction?utm_campaign=ac&utm_medium=email&utm_source=golangweekly) — Declare infrastructure in your Go program and get self-provisioning local, preview, and cloud environments (AWS/GCP). 

Encore sponsor   

[Using Goquery for Data Parsing](https://www.zenrows.com/blog/goquery) — If you’d like a jQuery-esque way of working with the DOM.. 

ZenRows   

[Building Scalable Apps Using Redis as a Message Broker](https://semaphoreci.com/blog/redis-message-broker) 
Tomas Fernandez  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/aczug1pqgnq5blkq0kw6.jpg)](https://autostrada.dev/)  

[Autostrada: A Codebase Generator for Go Projects](https://autostrada.dev/) — A site that lets you pick from a variety of options (webapp vs JSON API, SQLite vs Postgres – add auth, secure cookies, sessions, etc.) and then download a custom codebase built from those options to continue building an app with. 

Alex Edwards   

[CLI Mate: Auto-Generate Go CLIs](https://github.com/avamsi/climate) — Supports nested subcommands, global/local flags, help generation from godocs, typo suggestions, shell completion and more. Inspired by python-fire and powered by Cobra. 

Vamsi Avula   

[Monitor, Test and Document your APIs with APIToolkit](https://apitoolkit.io?utm_campaign=cooperpress) — A toolbox for building and maintaining APIs better than ever. Test and validate all API requests, and spot bugs faster. 

APIToolkit sponsor   

[Logging in Go: A Comparison of 8 Libraries](https://betterstack.com/community/guides/logging/best-golang-logging-libraries/) — With the introduction of a new core standard logging package (`log/slog`) in 1.21, are all open-source logging libraries obsolete? Ayooluwa looks at 7 of them (plus slog) and gives his opinion. 

Ayooluwa Isaiah   

[LotusDB 2.0: A Key/Value Store Built in Go](https://github.com/lotusdblabs/lotusdb) — A Go-native key/value store that boasts high read and write performance and combines the advantages of LSM and B+ trees. Docs are a little thin on the ground but there’s a complete example in the README and [an introductory post on Medium](https://medium.com/@roseduan520/lotusdb-a-fast-kv-database-in-go-60ea93b2387b). 

LotusDB Labs   

[Expr 1.15.0: Expression Evaluation Within Go](https://github.com/antonmedv/expr/releases/tag/v1.15.0) — Got expressions? Expr is an engine for evaluating them, whether it’s for arithmetic, business rules, or data filtering. [GitHub repo](https://github.com/antonmedv/expr). 

Anton Medvedev   

- [Pion TURN 3.0](https://github.com/pion/turn)
 ↳ Toolkit for building TURN clients and servers in Go.
- [oapi-codegen 1.14](https://github.com/deepmap/oapi-codegen)
 ↳ Generate client/server boilerplate from OpenAPI specs.
- [go2rtc 1.7](https://github.com/AlexxIT/go2rtc)
 ↳ Camera streaming with RTSP, WebRTC, FFmpeg, RTMP, etc.
- [JuiceFS 1.1](https://github.com/juicedata/juicefs/releases/tag/v1.1.0)
 ↳ Distributed POSIX file system atop Redis & S3.
- [Miller 6.9](https://github.com/johnkerl/miller)
 ↳ Like `awk`, `sed`, `cut`, `join`, and `sort` for CSV.
- [DNSControl 4.3](https://github.com/StackExchange/dnscontrol/releases/tag/v4.3.0)
 ↳ Synchronize DNS to multiple providers.
- [Fibratus 2.0](https://github.com/rabbitstack/fibratus) – Windows kernel exploration tool.
- [GoBGP 3.18](https://github.com/osrg/gobgp) – BGP implementation in Go.    

Jobs  

[Find a Job Through Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-golangweekly%29&utm_content=find-your-next-job) — Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now. 
Hired      

[GotHub: An Alternative GitHub Frontend / Proxy](https://codeberg.org/gothub/gothub) — It’s not a typo, but a Go-powered alternative front-end for GitHub. It’s also [looking for new maintainers](https://codeberg.org/gothub/gothub/issues/131). 

Arya K         

Curated by Peter Cooper and [Glenn Goodrich](https://twitter.com/ruprict). 

[Change your email](https://golangweekly.com/edit_subscription/*|UID|*)
[Stop getting this newsletter](https://golangweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
