Handling concurrency is hard, even if it was made simple.
The Go 1.19 Atomic Wrappers and why to use them explores the sync/atomic package which was introduced in Go 1.19 and use cases for it.
I haven't used this one personally, but we have
#go #programming
The Go 1.19 Atomic Wrappers and why to use them explores the sync/atomic package which was introduced in Go 1.19 and use cases for it.
I haven't used this one personally, but we have
sync.Map
in one of the projects to get the results from goroutines in one place.#go #programming
Medium
The Go 1.19 Atomic Wrappers and why to use them
Here’s a short blog on Go’s (1.19+) sync/atomic additions to the library and why you’d want to use them. This article will assume that you…
Dead simple method of profiling your Go applications.
tl;dr:
- Import the
- Add
- Add
#programming #golang
tl;dr:
- Import the
github.com/pkg/profile
package- Add
defer profile.Start().Stop()
into your main
function for CPU profile- Add
defer profile.Start(profile.MemProfile).Stop()
for memory profile#programming #golang
Flaviocopes
Getting started with Go CPU and memory profiling
I help people learn to code.
Avoiding Pitfalls in Go is a good article for those who just starts their journey with this language.
Yet, there are some aspects that are useful even if you use it already. Especially, if your use cases were limited to some simple code.
#programming #go
Yet, there are some aspects that are useful even if you use it already. Especially, if your use cases were limited to some simple code.
#programming #go
Dolthub
Avoiding Pitfalls in Go
Blog for DoltHub, a website hosting databases made with Dolt, an open-source version-controlled SQL database with Git-like semantics.
Bounded channels is a common way of limiting the concurrency in Go applications.
From this article you can learn some theory behind this approach as well as about the
#programming #go
From this article you can learn some theory behind this approach as well as about the
sync/semaphore
package. I didn’t know about the latter.#programming #go
Medium
Go’s Extended Concurrency: Semaphores (Part 1)
Goroutines, Channels and Mutexes — if you’ve spent any significant time with Go’s tried and true synchronization primitives at all you…
For a bit longer than a week you can buy the Python Crash Course book from Humble Bundle with 45% discount.
I personally don’t use Python, but I know that it’s pretty popular in platform engineering. So, this offer may be interesting to you.
#books #programming #python hon
I personally don’t use Python, but I know that it’s pretty popular in platform engineering. So, this offer may be interesting to you.
#books #programming #python hon
Humble Bundle
Buy Python Crash Course, 3rd Edition from the Humble Store
Python Crash Course is the world’s best-selling guide to the Python programming language. This fast-paced, thorough introduction will have you writing programs, solving problems, and developing functioning applications in no time.You’ll start by learning…
Programming Book Bundle by Packt.
I don’t know if you do programming day-to-day. Also, this channel is more OPS oriented, I would say.
However, you may find some interesting stuff there.
#programming #books
I don’t know if you do programming day-to-day. Also, this channel is more OPS oriented, I would say.
However, you may find some interesting stuff there.
#programming #books
Humble Bundle
Humble Tech Book Bundle: Programming MEGA Bundle 2023 by Packt
We’ve teamed up with Packt for our newest bundle. Get programming and coding ebooks like Azure Integration Guide for Business. Plus, pay what you want & support charity!
I think I have posted something like this before, but anyway...
Here's a two part story of how to optimize memory usage of a Go application just by reshuffling fields in structs.
Part one provides some theory on this matter, while part two has some benchmarking results.
I'm not trying to say that you should run and reshuffle fields in all your Go structs right now. Especially, if you're satisfied with the memory consumption of your app - sometimes it makes sense to optimize for readability or just store pointers in structs.
However, these articles describe some details of how memory allocation works in Go, which you may find interesting.
#programming #go
Here's a two part story of how to optimize memory usage of a Go application just by reshuffling fields in structs.
Part one provides some theory on this matter, while part two has some benchmarking results.
I'm not trying to say that you should run and reshuffle fields in all your Go structs right now. Especially, if you're satisfied with the memory consumption of your app - sometimes it makes sense to optimize for readability or just store pointers in structs.
However, these articles describe some details of how memory allocation works in Go, which you may find interesting.
#programming #go
Programming Bytes with Satyarth
Golang Structs Memory Allocation
The article discusses about Golang memory allocation inside structs and how it can be optimized for better performance.
An opinionated article that claims that one has to keep all the dependencies in version control.
Now, I don’t have strong opinions here. On one hand the proposal in this article sounds extreme. On another hand, my team has quite a few Go projects and we use vendored modules there.
So, we actually keep the dependencies in VCS. As anything else, it has its pros and cons. I could build a project and run some isolated tests on a plane. But also it almost impossible to review a PR that touches that
The author points out that it’s Git’s fault that it’s not designed to work with large number of files and files of a large size. Yes, I’d ask for a reality check here, some Git is omnipresent these days.
#programming #git #opinion
Now, I don’t have strong opinions here. On one hand the proposal in this article sounds extreme. On another hand, my team has quite a few Go projects and we use vendored modules there.
So, we actually keep the dependencies in VCS. As anything else, it has its pros and cons. I could build a project and run some isolated tests on a plane. But also it almost impossible to review a PR that touches that
vendor/
directory.The author points out that it’s Git’s fault that it’s not designed to work with large number of files and files of a large size. Yes, I’d ask for a reality check here, some Git is omnipresent these days.
#programming #git #opinion
Forrestthewoods
Dependencies Belong in Version Control
Why dependencies should be checked into version control.
A brief glance into how Uber’s ETA calculator works.
tl;dr: Graph segmentation and smart guessing.
#programming #system_design
tl;dr: Graph segmentation and smart guessing.
#programming #system_design
newsletter.systemdesign.one
How Uber Computes ETA at Half a Million Requests per Second
#26: And How Online Maps Work Explained Like You’re Twelve (5 minutes)
There was an interesting talk at CfgMgmtCamp 2024 about non blocking code reviews.
The good thing is that there’s also an article on this topic from the author
The general idea is that not all the code changes require a code review, especially when there are enough safety nets configured.
As a result, smaller code changes simply sit there and wait for be reviewed, which may take some time, especially in a remote setup.
The solution is to allow such changes as they are and add them to a backlog of pending reviews.
There are more details in the article. Also, here’s a picture from that presentation that kinda captures the spirit of this idea.
#programming #culture #devops
The good thing is that there’s also an article on this topic from the author
The general idea is that not all the code changes require a code review, especially when there are enough safety nets configured.
As a result, smaller code changes simply sit there and wait for be reviewed, which may take some time, especially in a remote setup.
The solution is to allow such changes as they are and add them to a backlog of pending reviews.
There are more details in the article. Also, here’s a picture from that presentation that kinda captures the spirit of this idea.
#programming #culture #devops
A programming books bundle on Humble Bundle by Manning Press.
There are a couple of books that could be interesting to you, even if programming is not your primary occupation.
#books #programming
There are a couple of books that could be interesting to you, even if programming is not your primary occupation.
#books #programming
Humble Bundle
Humble Tech Book Bundle: Code Like a Pro 2024 by Manning
Tackle coding challenges head-on with this book bundle from Manning! Learn about the strengths of Python, Rust, Go & more! Your purchase helps Girls Who Code.
Go is super popular in platform engineering. Just recently I participated in a discussion about it on Reddit :D
And at last, HumbleBundle has a book collection dedicated to this language!
#go #programming #books
And at last, HumbleBundle has a book collection dedicated to this language!
#go #programming #books
Humble Bundle
Golang Programming by Packt
Add the powerful open source language Go to your programming repertoire with this bundle of 19 books! Your purchase helps Save the Children.
Programming skills are essential for work in tech. So, here is a book bundle by Pearson with some books that may help you with those skills.
#books #programming
#books #programming
Humble Bundle
Humble Tech Book Bundle: Learn to Program by Pearson
The time is now! Learn to code with this bundle of books from Pearson, covering Python, Javascript & much more! Pay what you want and help support Code.org.
Ruby was the first programming language I tried to consciously learn. Meaning, it wasn't a part of a university curriculum or something.
Despite not using it for many years, I still have some warm feelings towards this language. In this article Lucas Seiki Oshiro argues that Ruby is good for shell scripts as well.
Ruby is strongly associated with the Rails framework. So, I think this article is a good reminder that programming languages are more than just frameworks.
#programming #ruby
Despite not using it for many years, I still have some warm feelings towards this language. In this article Lucas Seiki Oshiro argues that Ruby is good for shell scripts as well.
Ruby is strongly associated with the Rails framework. So, I think this article is a good reminder that programming languages are more than just frameworks.
#programming #ruby
Lucas Seiki Oshiro
Ruby: a great language for shell scripts!
It’s more than rails!
Amazing Julia Evans posts about the things she missed in Go.
This is kinda a promotion of the book "100 Go Mistakes and How to Avoid Them" and you know what, now I want to read it!
P.S. Unfortunately, I don't have a chance to write much in Go lately, which makes me sad. Maybe, it will push me towards creating some side-projects, probably, someday, maybe 😭
#programming #golang
This is kinda a promotion of the book "100 Go Mistakes and How to Avoid Them" and you know what, now I want to read it!
P.S. Unfortunately, I don't have a chance to write much in Go lately, which makes me sad. Maybe, it will push me towards creating some side-projects, probably, someday, maybe 😭
#programming #golang
Julia Evans
Go structs are copied on assignment (and other things about Go I'd missed)
Some people know that I'm not a fan of Python. Yet, I have to tolerate it because it is objectively one of the most popular and widespread programming languages.
So, here is an article about asynchronous code in Python.
Enjoy!
#programming #python
So, here is an article about asynchronous code in Python.
Enjoy!
#programming #python