Open in app

Sign In

Write

Sign In

Teiva Harsanyi
Teiva Harsanyi

3.8K Followers

Home

About

Pinned

I Completed All 8 Advents of Code in One Go: Here Are the Lessons I Learned.

Context Last December, I completed my first Advent Of Code: 2022. Before that, I had a total of something like six stars for the past seven years. But this year, we created a private leaderboard at Docker, and it motivated me to go as far as possible. For those unfamiliar with…

Programming

12 min read

I Completed All 8 Advents of Code in One Go: Here Are the Lessons I Learned.
I Completed All 8 Advents of Code in One Go: Here Are the Lessons I Learned.
Programming

12 min read


Pinned

📖 100 Go Mistakes: Released!

After almost three years of work, I wanted to announce that my book, 100 Go Mistakes and How to Avoid Them, has finally been released 🎉. 100 Go Mistakes and How to Avoid Them shows you how to replace common programming problems in Go with idiomatic, expressive code. In it…

Golang

3 min read

📖 100 Go Mistakes: Released!
📖 100 Go Mistakes: Released!
Golang

3 min read


Dec 23, 2022

Profiling and Execution Tracing in Go

Go offers a few excellent diagnostics tools to help us get insights into how an application performs. This post focuses on the most important ones: profiling and the execution tracer. Both tools are so important that they should be part of the core toolset of any Go developer who is…

Golang

13 min read

Profiling and Execution Tracing in Go
Profiling and Execution Tracing in Go
Golang

13 min read


Nov 9, 2022

Slice length vs. capacity in Go

TL;DR: The slice length is the number of available elements in the slice, whereas the slice capacity is the number of elements in the backing array, counting from the first element in the slice. It’s pretty common for Go developers to mix slice length and capacity or not understand them…

Golang

6 min read

Slice length vs. capacity in Go
Slice length vs. capacity in Go
Golang

6 min read


Sep 28, 2022

Maps and Memory Leaks in Go

TL;DR: A map can always grow in memory; it never shrinks. Hence, if it leads to some memory issues, you can try different options, such as forcing Go to re-create the map or using pointers. When working with maps in Go, we need to understand some important characteristics of how…

Golang

6 min read

Maps and Memory Leaks in Go
Maps and Memory Leaks in Go
Golang

6 min read


Sep 14, 2022

Concurrency isn’t Always Faster in Go

TL;DR: To be a proficient developer, you must acknowledge that concurrency isn’t always faster. Solutions involving parallelization of minimal workloads may not necessarily be faster than a sequential implementation. Benchmarking sequential versus concurrent solutions should be the way to validate assumptions. A misconception among many developers is believing that a…

Golang

9 min read

Concurrency isn’t Always Faster in Go
Concurrency isn’t Always Faster in Go
Golang

9 min read


Aug 31, 2022

How to Write Accurate Benchmarks in Go

In general, we should never guess about performance. When writing optimizations, so many factors may come into play that even if we have a strong opinion about the results, it’s rarely a bad idea to test them. However, writing benchmarks isn’t straightforward. It can be pretty simple to write inaccurate…

Golang

11 min read

How to Write Accurate Benchmarks in Go
How to Write Accurate Benchmarks in Go
Golang

11 min read


Dec 15, 2021

When to Use Generics in Go?

Generics is a fresh addition to the language. In a nutshell, it allows writing code with types that can be specified later and instantiated when needed. However, it can be pretty easy to be confused about when to use generics and when not to. …

Golang

6 min read

When to Use Generics in Go?
When to Use Generics in Go?
Golang

6 min read


Jun 23, 2021

100 Go Mistakes (2022)

In 2019, I published a post called The Top 10 Most Common Mistakes I’ve Seen in Go Projects. As the name states, it was a way to explain some of the most common mistakes made by Go developers. This post was pretty much popular (at least for me), and I…

Go

4 min read

100 Go Mistakes (2022)
100 Go Mistakes (2022)
Go

4 min read


Nov 20, 2020

Mechanical Sympathy in Go

A couple of months ago, I wrote a post about Go and CPU Caches: https://teivah.medium.com/go-and-cpu-caches-af5d32cc5592 Then, I wanted to extend the scope of this post. Following this idea, I had the chance to give a talk to GopherCon Turkey 2020. The topic is the following: Mechanical Sympathy in Go. I tried to cover the following topics: CPU architecture introduction Locality of reference principles: temporal vs spatial locality, predictability, striding

Software Development

2 min read

Mechanical Sympathy in Go
Mechanical Sympathy in Go
Software Development

2 min read

Teiva Harsanyi

Teiva Harsanyi

3.8K Followers

Software Engineer @Google | 📖 100 Go Mistakes author | 改善

Following
  • Roman Leventov

    Roman Leventov

  • Netflix Technology Blog

    Netflix Technology Blog

  • Val Deleplace

    Val Deleplace

  • Niklas Göke

    Niklas Göke

  • Kent Beck

    Kent Beck

See all (47)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech