Rust Std Mutex vs Tokio Mutex

My last post was about benchmarking mutexes and actor model. I was wondering what’s a faster way to synchronize state and conclusion of my findings was that mutexes are 2-3 times faster depending on the exact Actor implementation. There was one underlying assumption that I didn’t specify explicitly in those benchmarks - I was using Tokio implementation of mutexes. Tokio mutexes are slower than their Std counterpart, so why would anyone pick them....

March 8, 2024

Rust - Mutex vs Actor benchmark

Hello, this post is quick summary of my findings when I was benchmarking Actor model vs Mutex for concurrent access to value in async environment. All code for this benchmark is available in my github repo, but I’ve decided to copy some parts of implementation here. Actor implementation #[derive(Default)] pub struct BenchActor { count: i64, /// optional channel to signal when implementation reached REACHED_COUNT_SIGNAL_AMOUNT tx: Option<oneshot::Sender<()>>, } pub enum Message { IncreaseBySync(i64, oneshot::Sender<()>), DecreaseBySync(i64, oneshot::Sender<()>), IncreaseBy(i64), DecreaseBy(i64), Get(oneshot::Sender<i64>), } impl BenchActor { pub fn new(m: oneshot::Sender<()>) -> Self { Self { tx: Some(m), ....

January 30, 2024

Golang + Ethereum = ?

One of my recent jobs required me to interact with Ethereum network heavily. This was my first chance to develop actual working product on this network and this short post summarizes my thoughts about this experience. Does Golang play nicely with ETH network? Is it a good fit to develop services for such tasks? Let’s see. Go-Ethereum Fundamental part of Golang Ethereum story is Go-Ethereum package. It’s… okay. In general Go fashion it provides you with wide array of all basic operations you need to do and nothing more....

January 6, 2024

Golang vs Rust

Yes, it’s another one of those 😈 My programming journey started few years ago with typescript (unsurprisingly), but sooner rather than later I’ve developed a view that typescript doesn’t have any advantages on the backend. Seriously, does typescript have any advantages over alternatives in this space? It’s interpreted, so we need to package runtime with our code to get it to work, even if it doesn’t have benefits of compiled languages we need compile step, it doesn’t have good native tooling (you need 3rd party projects for things like formatting), it’s not very safe language (f....

December 20, 2023

Perfect programming language

Hello, as someone that likes to try out new things I’ve used plenty of programming languages, some popular, some niche and not widely known. This post sums up my experiences as wishlist of things I’d like my perfect language to have. This list is obviously subjective and there are some things that I might like, but you don’t - if that’s the case feel free to write comment with things you disagree with....

December 12, 2023

Why You should be using Nix instead of Dockerfiles

Lately I’ve had to move building and pushing docker images process to CI. To my surprise it wasn’t as straightforward as it should be. Building images on GitHub CI runner worked just fine, but my image registry had no SSL and adding ‘insecure’ registry to docker can be a pain. Sure - I could write script that changes docker daemon.json configuration and restarts it, but it felt like a hack. I’ve also tried using podman and buildah, but both of them didn’t seem to get the job done in easy manner....

October 26, 2023

Typescript is overhyped

Every time you ask someone what his favorite programming language is, chances are they’ll respond “Typescript!”. I think most people just don’t have much contact with wide range of technologies and will usually pick language they use the most as their ‘favorite’. It’s even more obvious in case of Typescript which with all its flaws is infinitely better than JavaScript, so in comparison it seems like the best thing in the world....

May 30, 2023

GraphQL vs REST, which one is better?

As part of my bachelor thesis I’ve made some REST/GraphQL benchmarks that I’ve thought some of you might find interesting. Let’s start with short overview of both technologies. REST Probably the most popular way of making API services right now. REST stands for Representational state transfer and APIs that follow REST rules are called “RESTful” APIs. In REST resource that you want to operate on is defined by some URI like http://your....

May 27, 2023

The Best Kubernetes Development Workflow

At the start I want to point out that all opinions in this piece are just that - opinions. I’ve tried multiple workflows and all I want to do in this article is sharing what I’ve landed at and what difficulties I’ve had using other methods of developing in Kubernetes. My main motivation for writing it is sparing someone difficulties related with setting up dev environment. There are many solutions out there claiming that they make working with k8s easier, but with greater ease of development comes another layer of abstraction that sometimes might actually make things worse....

May 13, 2023

Why I migrated from WSL2 and Windows to Linux

Hello everyone, this time I’ll share why I stopped using Windows with WSL2 (Windows subsystem for Linux) as my development environment and instead opted for dual boot setup (I’m keeping Windows just for few games that don’t work very well with Linux). To make it more clear I should probably share my dev experience with WSL2 first. My dev environment journey I’ve started programming a few years ago (probably around 2017) with Windows as my primary system....

May 3, 2023