RSSAmplifier

Blog

Graham King

Recent content on Graham King

darkcoding.netRSS feed ↗257 posts

Latest posts

Evaluating LLMs for my personal use case

My life is not a math Olympiad

Underrust: What is the cost of Mutex, RwLock and AtomicPtr?

With many concurrent readers and a single occasional writer, which mutual exclusion primitive should you use? Let's look at the assembly to find out.

Underrust: How does u128 work on a 64-bit processor?

Wherein our hero learns the arcane secrets of the u128 sword in the depths of the Underrust.

Rust HashMap notes

Raw notes on Rust's HashMap design and implementation

CPU Performance Optimization notes

Raw notes on CPU optimization

Transparent Software

A software system is transparent when you can look at it and immediately understand what it is doing and how.

Travels with ChatGPT

An overconfident genius personal assistant in my pocket

AI Hallucinations Are Often Reasonable Suggestions

Don't dismiss the statistically probable

Underrust: What does vec![0u8; 1024] really do?

How does Rust allocate a zeroed Vec and what does it cost?

The memory remains: Permanent memory with systemd and a Rust allocator

A Rust object that survives program restart thanks to Rust allocators, systemd's file descriptor store, and syscall memfd_create.

Linux: What can you epoll?

On Linux what can you turn into a file descriptor and then monitor with epoll?

Underrust: Multiple Return Values

How does Rust return values, and does it make any difference to us programmers?

Overthinking Leetcode's Two Sum with SIMD

When is the linear scan Two Sum solution faster than a map? What if we use AVX-512 instructions?

Underrust: What is the cost of sync::Once?

In Rust, what is the performance cost of using sync::Once after the initial setup?

Underrust: Does it matter what type (u8, u32, ...) I use?

In Rust, how does using a different primitive type (u8, i32, u64, ...) change the generated assembly?

The Underrust: Rust's assembly output

Assembly: In all the world of the programmer, there is no more important output.

A very small Rust binary indeed

Can we make a Rust program that's as small as it's assembler equivalent?

A random number you already have: The stack address

Thanks to Address Space Layout Randomization you can use the address of a stack variable as a zero-cost random number.

Return Value Optimization in Rust

Rust avoids memory copies by optimizing return value placement.

Rust atomics on x86: How and why

On x86 it doesn't really matter what sync::atomic::Ordering you choose.

Rust is also C

Safety is boring, let's do pointer arithmetic.

epoll: The API that powers the modern internet

Linux's epoll API solved the C10K problem, enabling fast and afforable Internet services.

Scripting Minecraft server with Python

Minecraft has an API. If you run your own server you can program it from Python.

Rust Performance 101 in 5 Minutes

Is your Rust program CPU bound? Here are the very first things you can do on Linux.

CPU silently disappointed with your choice of instruction ordering

An adventure in CPU out-of-order instruction execution.

Traits: Rust's unifying concept

Rust's traits are a single concept that unifies interfaces, abstract classes, mix-ins, operator overloading, contraints on generics, and more.

A day in the life of a professional software engineer

Just a normal day reversing linked lists on the whiteboard.

Three things I wish I’d known learning Rust

It will take longer to learn than most languages, the standard library is small so you'll need dependencies, and a lot of behavior is in traits.

Quote of the day: A stirring speech

... because, at every new incident, your fortitude was to be called forth, and your courage exhibited; because danger and death surrounded it, and these you were to brave and overcome. For this was it a glorious, for this was it an honourable undertaking.

The simplest CLI that could possibly work

In Go, what's the simplest possible way to put all your ad-hoc tools in one place?

Collect and handle multiple errors in Go

In Go, how do you run several operations that might return an error, and return those errors at the end? Here's how I do it.

A developer goes to a DevOps conference

Two days at PDX DevOpsDays, a gathering of system administrators who use version control, and write a lot of YAML.

Reading MediaRecorder’s webm/opus output

Making like Theseus in the WEBM/MATROSKA/EBML audio maze

Javascript’s async/await and Promise in a few words

Unraveling the magic of async/await: From callbacks to linear code.

Growing software, in two tweets

Cultivating code: From seedling to flourishing software garden.

What Made Maddy Run

Unveiling the hidden struggles behind a perfect facade.

Learn Better – book notes

Unlock your learning potential: Practical tips for mastering any skill.

systemd socket activation in Go

'Unlock root-level ports without root privileges: A guide to systemd socket activation'

The Joy of systemd

Embracing the future: A quick guide to systemd for modern daemon management.

How Ada Lovelace solved problems

Ada Lovelace: Debugging by horseback since 1843.

Facebook’s code quality problem

'Move fast and break things: A cautionary tale from Facebook's code quality woes.'

Decrypt your HTTPS traffic with mitmproxy

Decrypt, inspect, and debug HTTPS traffic with mitmproxy and iptables.

OSCON 2015: Impressions

OSCON: Where open source meets commerce and connections bloom.

GopherCon 2015: Favorite talks

'GopherCon 2015: Where infrastructure meets innovation and inclusivity'

We are Equality

Equality in the digital realm: Where technology levels the playing field.

Building shared libraries in Go: Part 2

Seamlessly bridging Go and C++: A practical guide to shared libraries.

Building shared libraries in Go: Part 1

Unleash Go's power: Create shared libraries for seamless language integration!

How memory is allocated

Diving deep: How to allocate memory without malloc in Linux assembly.

Go: Slice search vs map lookup

Maps vs. slices: Choose wisely for optimal performance.

Software engineering practices

Timeless wisdom for crafting better code: Essential software engineering practices.