Optimizing a ring buffer for throughput (2021)
In this article I will take a look at the classic concurrent ring buffer and how it can be optimized to increase throughput.
Posts that commenters keep linking to, ranked by how many different people have cited them in Hacker News comments. 2,232 posts.
In this article I will take a look at the classic concurrent ring buffer and how it can be optimized to increase throughput.
Edit: Since this post, I've created an interactive tool for binary visualisation - see it at binvis.io
Sandspiel is a falling sand game I built in late 2018. I really enjoyed writing this game, and wanted to put into writing some of my goals, design decisions, and learnings from that process. If you’re reading this but haven’t played sandspiel, you should probably go try it !
On February 13, 2013, the Computer History Museum reported that they had received the source code for version 1.1 of Photoshop from Adobe, and had permission to release it for non-commercial use. This is the second time recently that something like this has happened, the first being the release of the Quickdraw and…
Random code snippets, projects and musings about software from Eric Kidd, a developer and occasional entrepreneur.
Emacs has a shell written entirely in Emacs Lisp. Here's how you master Eshell, a versatile and powerful shell capable of supplanting bash or zsh as your daily driver.
I know, I know, the world does not need yet another introduction to monads (or yet another article complaining that world does not need yet another introduction to monads). So you’ll be glad to know this isn’t one of those, in the sense that it’s not new. I thought I’d write it because, first, monads are worth knowing…
When I told my colleague Matt Gaunt I was thinking of writing a piece on microtask queueing and execution within the browser's event loop, he said "I'll be honest with you Jake, I'm not going to read that". Well, I've written it anyway, so we're all going to sit here and enjoy it, ok?
There are so many NoSQL systems these days that it's hard to get a quick overview of the major trade-offs involved when evaluating relational and non-relational systems in non-single-server...
Yesterday I was working on a small feature for the Rust compiler, and came across a situation which really showcased Rust’s awesomeness as a language …
Last weekend, I attended GitHub's PyCodeConf in Miami Florida and had the opportunity to give a talk on array-oriented computing and Python....
I authored 1 the announcement post on the Superlogical homepage , which describes the problem statement and what we're building. 2 Read that to learn more. This post is more of a personal statement about what led to this, how it relates to my recent work, and what comes next.
As a rule, "sophisticated" progrmming is pretty boring - optimizing the unnecessary to speed up the uninteresting. Here, however, is an incredibly sophisticated package intended for fun and games. The more you know about software, the more astounded you will become as you read this.
It's difficult to get the Windows Console to display Unicode characters, so here's a C++ WinForms program that will display the arguments in a TextBox.
Karl Seguin's Blog - A mix of coding and creative writing
This article appeared in Java Report, 5(7), July 2000 and C++ Report, 12(7), July/August 2000 .
Recently NixOS was posted to the Haskell reddit, and seems to have been received well. In the comments I mentioned that NixOS allows me to be a more productive Haskell developer, and I would like to discuss how I am using the features offered by NixOS. Before we get into those details, allow me to briefly summarise…
For the purposes of this post, I will be talking about JavaScript objects using syntax defined in ECMAScript 5.1. The basic semantics existed in Edition 3, but they were not well exposed. A Whole New Object In JavaScript, objects are pairs of keys and values (in Ruby, this structure
I wanted to know how a modern C compiler like clang would process the following C code: #include <stdint.h> int count(uint64_t x) { int v = 0; while(x != 0) { x &= x - 1; v++; } return v; } Can you guess? popcntq %rdi, %rax That is right. A fairly sophisticated C function, … Continue reading The surprising cleverness…
Ah, C. The best lingua franca we have… because we have no other lingua francas. Linguae franca. Surgeons general? C is fairly old — 44 years, now! — and comes from a time when there were possibly more architectures than programming languages. It works well for what it is, and what it is is a relatively simple layer of…
A while ago there was an interesting thread on the Julia Discourse about the “state of machine learning in Julia”. I posted a response discussing the differences between Julia and Python (both JAX and PyTorch), and it seemed to be really well received! Since then this topic seems to keep coming up, so I thought I’d…
"JVM Anatomy Quarks" is the on-going mini-post series, where every post is describing some elementary piece of knowledge about JVM. The name underlines the fact that the single post cannot be taken in isolation, and most pieces described here are going to readily interact with each other.
Joe Duffy's Blog | Adventures in the high-tech underbelly
Quick edit: While I work on a proper update, I'll note here that several posters on reddit and hackernews have pointed out ways to bring the total size of the program down to 105 bytes while still printing the full "Hello, world!" Much credit goes to Josh Triplett , who produced the 105-byte version which you can find…
The setup.py interface is an old convention from distutils, one that has bugs that cannot be fixed to bring it into line with modern Python packaging approaches. As a result, all direct...
One of the big features for Go 1.1 is the new scheduler, contributed by Dmitry Vyukov. The new scheduler has given a dramatic increase in performance for parallel Go programs and with nothing better to do, I figured I'd write something about it.