---
title: "Using 97 fewer cores thanks to PGO"
publication: "Go Weekly"
issue: 507
published_at: "2024-05-14"
canonical_url: "https://golangweekly.com/issues/507"
---

Plus an HNSW indexed vector store library, a new Go game hits the Steam store, and is 'ok' ok?. |        

#​507 — May 14, 2024 

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

Together with [![Stytch logo\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,e_trim,w_250,h_100/e_make_transparent/co_white,e_outline:7/ybmf19rrsbnymq3rn7n3.png)](https://stytch.com?utm_source=go-weekly&utm_medium=paid_sponsorship&utm_content=go-weekly-05-14-2024&utm_campaign=go-weekly-05-14-2024)  

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/ibix9gnzb7cezjijmyjz.jpg)](https://blog.cloudflare.com/reclaiming-cpu-for-free-with-pgo/)  

[Reclaiming CPU for Free with PGO](https://blog.cloudflare.com/reclaiming-cpu-for-free-with-pgo/) — We’ve previously featured [Dolt’s experiences with PGO](https://www.dolthub.com/blog/2024-02-02-profile-guided-optimization/) but Cloudflare has been experimenting and benefiting from Go 1.20+’s [profile-guided optimization](https://go.dev/doc/pgo) too. At Cloudflare’s scale of running Go-based services across _thousands of cores_, the end result is quite striking. 

Colin Douch (Cloudflare)   

[`ok` Considered Harmful?](https://www.dolthub.com/blog/2024-05-10-ok-considered-harmful/) — _“Just like there’s an unwritten law that every error variable in Go must be named `err`, there’s an unwritten law that every map existence variable in Go must be named `ok`.”_ But Zach thinks we can, and should, look at doing better. 

Zach Musgrave   [![\](https://copm.s3.amazonaws.com/db501436.png)](https://stytch.com?utm_source=go-weekly&utm_medium=paid_sponsorship&utm_content=go-weekly-05-14-2024&utm_campaign=go-weekly-05-14-2024) 

[Stytch: Auth0 Alternative for AuthN, AuthZ, Fraud Prevention](https://stytch.com?utm_source=go-weekly&utm_medium=paid_sponsorship&utm_content=go-weekly-05-14-2024&utm_campaign=go-weekly-05-14-2024) — Use Stytch for enterprise-grade multi-tenant B2B auth with SSO, RBAC, and SCIM. Use pre-built UIs, go headless, or integrate directly with the API. Plus, Stytch has device fingerprinting built-in to detect bots and prevent abuse. [Get started free](https://stytch.com?utm_source=go-weekly&utm_medium=paid_sponsorship&utm_content=go-weekly-05-14-2024&utm_campaign=go-weekly-05-14-2024). 

Stytch sponsor   

🗣️ [Do Gophers Really Tend to Build Everything From Scratch?](https://www.reddit.com/r/golang/comments/1cmk0bp/from_python_to_go_do_you_really_tend_to_build/l3170pi/) — Over on Reddit, a developer new to Go wondered why Go has few large scale frameworks and whether we tend to just build everything from scratch. The top response sums up a typical Go approach well – we have lots of great libraries, and Go makes it easy to compose them together. [Full thread.](https://www.reddit.com/r/golang/comments/1cmk0bp/from_python_to_go_do_you_really_tend_to_build/) 

Reddit   

_QUICK BITS:_ 

- 🕹️ Over [on Twitter,](https://twitter.com/raysan5) the creator of [Raylib](https://www.raylib.com/) noted that a new Go-powered game has hit the Steam store, the mildly violent looking, fast-paced [🧸 _Mr Snuggles Dungeon Adventure._](https://store.steampowered.com/app/2968730/Mr_Snuggles_Dungeon_Adventure/)
- 🔒 Juho Forsén looks at [Go's recent fixes for some code execution bugs](https://mattermost.com/blog/go-fixes-its-7th-code-execution-bug-in-the-same-feature/) relating to `CFLAGS` and`LDFLAGS`.   

[The Notifier Pattern for Apps That Use Postgres](https://brandur.org/notifier) — Brandur is a big fan of Postgres’s built-in pub/sub features. 

Brandur Leach   

[Building a Web App with Go and React](https://www.jetbrains.com/guide/go/tutorials/webapp_go_react_part_one/) — The goal of this series seems to be to show off JetBrains’ _GoLand_ IDE, with less focus on the design of the app itself. This does not, however, mean it’s not useful to see how the parts come together. 

Ryan Peden (JetBrains)   

[Create a DNS Resolver with Go](https://domenicoluciani.com/2024/05/07/create-dns-resolver.html) — There are plenty of ways to do this quickly, but if you want to dig into the packets and learn _how_ it works, why not? 

Domenico Luciani   

[Product for Engineers: A Newsletter Helping Flex Your Product Muscle](https://newsletter.posthog.com/?utm_source=gonews&utm_campaign=gonews) — Subscribe to get curated advice on building great products and best practices of top startups. 

PostHog sponsor   

[How I Made My GitHub Profile README Dynamic](https://tduyng.github.io/blog/dynamic-github-profile-readme/) — There’s no Go here, alas, but a neat demo of how it’s not too tricky to give your GitHub profile extra flair by pulling in blog posts or other info. 

Duy Ng   

📺 [Build Your Own Distributed System Using Go](https://www.youtube.com/watch?v=8XbxQ1Epi5w) – A talk from GopherCon 2023 that’s just been published. Philip O'Toole 

📄 [Using the `crypto/aes` and `crypto/cipher` Packages](https://aran.dev/posts/using-golang-crypto-aes-and-crypto-cipher-packages/) Aran Wilkinson 

📄 [A Basic Example of Using DuckDB from Go](https://cpn.jjude.com/@jjude/statuses/01HXBY7JZEQ8S8N34EMX1ESF3K) Joseph Jude 

📄 [Creating a More Sustainable Model for `oapi-codegen` in the Future](https://www.jvt.me/posts/2024/05/09/oapi-codegen-sustainable/) Jamie Tanna 

📺 [A Nine Hour Go Course for Beginners](https://www.youtube.com/watch?v=un6ZyFkqFKo) Lane Wagner  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/ukoexswy8ixlmclsfgzb.jpg)](https://chapar.rest/)  

[Chapar: An In-Development API Testing Tool](https://chapar.rest/) — Built in Go using the [Gio UI](https://gioui.org/) library, Chapar is designed for testing both HTTP and gRPC-based APIs in a slightly Postman-like fashion. It’s still under development but is ready to try out, says the author. [GitHub repo](https://github.com/chapar-rest/chapar). 

Mohsen Mirzakhani   

[hnsw: In-Memory HNSW Vector Indexing for Go](https://github.com/coder/hnsw) — A library providing a simple, in-memory vector database. HNSW stands for [Hierarchical Navigable Small Worlds](https://www.pinecone.io/learn/series/faiss/hnsw/) and is a way of indexing vectors by way of a multi-layer graph. 

Ammar Bandukwala      

📰 Classifieds   

Your fastest path to production. [With Render you can Build, deploy, and scale your apps with unparalleled ease](https://render.com) – from your first user to your billionth. 

--- 

📅 [Moar Serverless!! 2024](https://cfe.dev/events/moar-serverless-2024/) is a free, one day online event taking place on May 23 featuring several speakers sharing the latest news and technologies for building serverless solutions.      

[Actionlint: Static Checker for GitHub Actions Workflow Files](https://github.com/rhysd/actionlint) — GitHub Actions workflow files are notoriously tricky to get right, so this could be helpful. You can also [try it online via this playground.](https://rhysd.github.io/actionlint/) 

rhysd   

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/ks9kgqa02wwwbfva0q8u.jpg)](https://github.com/Zxilly/go-size-analyzer)  

[go-size-analyzer: Analyze the Size of Dependencies in Compiled Go Binaries](https://github.com/Zxilly/go-size-analyzer) — We linked to this handy tool a few weeks ago, but it’s had a significant 1.0 update with support for a new [terminal-based view](https://github.com/Zxilly/go-size-analyzer?tab=readme-ov-file#terminal-ui-experimental) of just what all those bytes are being used for in your binaries. 

Zxilly   

- [GoReleaser 1.26](https://carlosbecker.com/posts/goreleaser-v1.26) – Build/release binaries for multiple platforms. It's anticipated to be the last minor v1 release prior to an eventual v2.
- [UUID 5.2](https://github.com/gofrs/uuid/releases/tag/v5.2.0) – RFC-9562-compliant UUID generation library. Now with updates to UUID v6 and v7 to match new specs.
- [Go OpenAI 1.24.0](https://github.com/sashabaranov/go-openai/releases/tag/v1.24.0) – Adds support for OpenAI's new [GPT-4o model.](https://openai.com/index/hello-gpt-4o/)
- [GPTScript 0.6](https://github.com/gptscript-ai/gptscript) – Natural language programming with AI.
- [River 0.6](https://github.com/riverqueue/river) – Fast and reliable background jobs in Go.
- [DoltgreSQL 1.38](https://github.com/dolthub/dolt/releases/tag/v1.38.0) – Version-controlled Postgres, built in Go.
- [go-github 62.0](https://github.com/google/go-github/releases/tag/v62.0.0) – GitHub v3 API client library.         

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
