Forwarded from Max
Друзі! Ви, напевно, пам'ятаєте, як я робив збори для хлопців із ЗСУ та інших підрозділів. Хлопців, яких знаю особисто.
Не так давно ми разом з вами вже зробили велику справу — зібрали на два Mavic 3 Combo, Starlink і інші, не меньш важливі на війні штуки. Військові за це ДУЖЕ вдячні вам всім! Але добрих справ в такий час не буває забагато.
Маємо запит на автівку для наших воїнів ССО. Ціль — 260 000 гривень. Допоможемо хлопцям створити для окупанта пекло на нашiй землі.
Кожна гривня, кожен репост — ще один крок до нашої перемоги. Дуже вам вдячний!
🔗Посилання на банку
https://send.monobank.ua/jar/13NzQaQmS
💳Номер картки банки
5375 4112 0530 6157
Paypal: [email protected]
Не так давно ми разом з вами вже зробили велику справу — зібрали на два Mavic 3 Combo, Starlink і інші, не меньш важливі на війні штуки. Військові за це ДУЖЕ вдячні вам всім! Але добрих справ в такий час не буває забагато.
Маємо запит на автівку для наших воїнів ССО. Ціль — 260 000 гривень. Допоможемо хлопцям створити для окупанта пекло на нашiй землі.
Кожна гривня, кожен репост — ще один крок до нашої перемоги. Дуже вам вдячний!
🔗Посилання на банку
https://send.monobank.ua/jar/13NzQaQmS
💳Номер картки банки
5375 4112 0530 6157
Paypal: [email protected]
❤36💩25
Forwarded from 🇺🇦 Go performance channel (Oleg Kovalov)
High-performance JSON parsing in #golang by @CockroachDB
https://www.cockroachlabs.com/blog/high-performance-json-parsing/
https://www.cockroachlabs.com/blog/high-performance-json-parsing/
Cockroachlabs
High-performance JSON parsing in Go
This blog post is an exploration of JSON parser performance, and, ultimately, a description of the high-performance JSON parser used in CockroachDB.
🔥4
Repo with some examples of concurrency patterns in Golang ->
https://github.com/lotusirous/go-concurrency-patterns
https://github.com/lotusirous/go-concurrency-patterns
GitHub
GitHub - lotusirous/go-concurrency-patterns: Concurrency patterns in Go
Concurrency patterns in Go. Contribute to lotusirous/go-concurrency-patterns development by creating an account on GitHub.
👍6👎3
Forwarded from 🇺🇦 Go performance channel (Oleg Kovalov 🇺🇦)
print(“lol”) doubled the speed of my #golang function 😂
https://medium.com/@ludirehak/printing-lol-doubled-the-speed-of-my-go-code-e32e02fc3f92
https://medium.com/@ludirehak/printing-lol-doubled-the-speed-of-my-go-code-e32e02fc3f92
Medium
print(“lol”) doubled the speed of my Go function
Here is a Go function, if_max(). It finds the max value of an array of integers. Simple enough:
🔥5
Limit goroutines with buffered channels
https://rednafi.com/go/limit_goroutines_with_buffered_channels/
https://rednafi.com/go/limit_goroutines_with_buffered_channels/
Redowan's Reflections
Limit goroutines with buffered channels
I was cobbling together a long-running Go script to send webhook messages to a system when
some events occur. The initial script would continuously poll a Kafka topic for events and
spawn new goroutines to make HTTP requests to the destination. This had two…
some events occur. The initial script would continuously poll a Kafka topic for events and
spawn new goroutines to make HTTP requests to the destination. This had two…
🤔2
"I thought I understood how iteration over an array works but apparently not in Golang"
https://medium.com/@haaawk/i-thought-i-understood-how-iteration-over-an-array-works-but-apparently-not-in-golang-441a7abd6540
https://medium.com/@haaawk/i-thought-i-understood-how-iteration-over-an-array-works-but-apparently-not-in-golang-441a7abd6540
Medium
I thought I understood how iteration over an array works but apparently not in Golang
I’ve recently learned about a surprising Golang behavior. You can significantly speed up the iteration over an array by doing:
👍2🤯2
Finally we can use it without many lines of
Tl;dr:
With all that out the way, we can use a heredoc, executing two commands in the same RUN!:
->
https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
/
and &&
Tl;dr:
With all that out the way, we can use a heredoc, executing two commands in the same RUN!:
RUN <<EOF
echo "Hello" >> /hello
echo "World!" >> /hello
EOF
->
https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/
Docker
Introduction to heredocs in Dockerfiles | Docker
Learn from Docker experts to simplify and advance your app development and management with Docker. Stay up to date on Docker events and new version
🔥11👍1
Slides of my talk from #kcdaustria about debugging #golang apps inside #k8s cluster
https://drive.google.com/file/d/1-6ERQda23o7OiLHziz4wwgvdFWS0kyv8/view
And repo with samples/Dockerfiles for try it out!
https://github.com/andriisoldatenko/debugging-containerized-go-applications
https://drive.google.com/file/d/1-6ERQda23o7OiLHziz4wwgvdFWS0kyv8/view
And repo with samples/Dockerfiles for try it out!
https://github.com/andriisoldatenko/debugging-containerized-go-applications
GitHub
GitHub - andriisoldatenko/debugging-containerized-go-applications: Different debug examples for dockerized Go application
Different debug examples for dockerized Go application - andriisoldatenko/debugging-containerized-go-applications
🔥9😐1
Discussion of 1BRC in Go https://github.com/gunnarmorling/1brc/discussions/67
Context: https://twitter.com/gunnarmorling posted a problem https://www.morling.dev/blog/one-billion-row-challenge/ the idea is pretty simple and from another side not so simple:
>write a Java program for retrieving temperature measurement values from a text file and calculating the min, mean, and max temperature per weather station. There’s just one caveat: the file has 1,000,000,000 rows!
Context: https://twitter.com/gunnarmorling posted a problem https://www.morling.dev/blog/one-billion-row-challenge/ the idea is pretty simple and from another side not so simple:
>write a Java program for retrieving temperature measurement values from a text file and calculating the min, mean, and max temperature per weather station. There’s just one caveat: the file has 1,000,000,000 rows!
GitHub
1BRC in Go · gunnarmorling/1brc · Discussion #67
Completes in ~20s on my machine, see https://github.com/AlexanderYastrebov/1brc/tree/go-implementation/src/main/go ~$ go version go version go1.21.4 linux/amd64 ~$ uname -r 4.15.0-213-generic ~$ ca...
👍2
Go’s CompareAndSwap is not always Compare-and-swap
>Go's standard package sync/atomics provides programmers with functions to use the underlying CPU-level atomic operations such as compare-and-swap (CAS), through atomic.CompareAndSwapT (where T is an integer type).
> Problem: Not all CPU architectures offers a CAS instruction to rely on to implement atomic.CompareAndSwapT. However, Go must compile that function code to something semantically equivalent—let's see what.
https://lu.sagebl.eu/notes/go-cas/
>Go's standard package sync/atomics provides programmers with functions to use the underlying CPU-level atomic operations such as compare-and-swap (CAS), through atomic.CompareAndSwapT (where T is an integer type).
> Problem: Not all CPU architectures offers a CAS instruction to rely on to implement atomic.CompareAndSwapT. However, Go must compile that function code to something semantically equivalent—let's see what.
https://lu.sagebl.eu/notes/go-cas/
Forwarded from 🇺🇦 Go performance channel (Oleg)
Hiring Challenge: Smallest #golang Websocket Client
https://dyte.io/blog/hiring-challenge-smallest-golang-websocket-client/ by @dyte_io
https://dyte.io/blog/hiring-challenge-smallest-golang-websocket-client/ by @dyte_io
Dyte
Hiring Challenge: Smallest golang Websocket Client
Learn to create a compact Go program for a websocket server, optimizing the binary size. Insights from a Dyte hiring challenge.
🔥5❤1
Collections what's new in Go 1.22:
- slices.Concat https://blog.carlana.net/post/2024/golang-slices-concat/
- reflect.TypeFor https://blog.carlana.net/post/2024/golang-reflect-type-for/
- https://pkg.go.dev/cmp#Or
- https://pkg.go.dev/net/http@master#FileServerFS
- https://pkg.go.dev/database/sql#Null
- slices.Concat https://blog.carlana.net/post/2024/golang-slices-concat/
- reflect.TypeFor https://blog.carlana.net/post/2024/golang-reflect-type-for/
- https://pkg.go.dev/cmp#Or
- https://pkg.go.dev/net/http@master#FileServerFS
- https://pkg.go.dev/database/sql#Null
👍8❤1
TIL: a % 128 = 0 is the same as a & 127 = 0
'Which is a faster operation since it just requires doing the AND and not the whole division and remainder comparison' @jesusvazquezp
from https://github.com/prometheus/prometheus/pull/14118#pullrequestreview-2068077407
'Which is a faster operation since it just requires doing the AND and not the whole division and remainder comparison' @jesusvazquezp
from https://github.com/prometheus/prometheus/pull/14118#pullrequestreview-2068077407
GitHub
Check context every 128 labels instead of 100 by colega · Pull Request #14118 · prometheus/prometheus
Follow up on #14096
As promised, I bring a benchmark, which shows a very small improvement if context is checked every 128 iterations of label instead of every 100.
It's much easier for a compu...
As promised, I bring a benchmark, which shows a very small improvement if context is checked every 128 iterations of label instead of every 100.
It's much easier for a compu...
👍4😢1
How do you track code coverage for OSS projects?
codecov seems very flaky, (will provide some details in thread)
wdyt about https://github.com/vladopajic/go-test-coverage?tab=readme-ov-file
codecov seems very flaky, (will provide some details in thread)
wdyt about https://github.com/vladopajic/go-test-coverage?tab=readme-ov-file
GitHub
GitHub - vladopajic/go-test-coverage: go-test-coverage is a tool designed to report issues when test coverage falls below a specified…
go-test-coverage is a tool designed to report issues when test coverage falls below a specified threshold - vladopajic/go-test-coverage
👍1