About:

Graham King is a software developer and blogger with interests in web development and server management, and enjoys photography.

Website:

Specializations:

Interests:

Web development Programming Server management

Incoming Links:

Subscribe to RSS:
The author evaluates various AI language models using 130 prompts from their bash history, categorizing them into programming, sysadmin, technical explanations, and general knowledge tasks. They compare models based on speed, cost...
The text discusses the cost of Mutex, RwLock, and AtomicPtr in Rust when dealing with resources that are read concurrently from many busy threads and modified rarely. It compares the assembly output and cost of uncontended read an...
The text is a conversation between Developer and Compiler Crab in the Underrust, discussing the mysteries of u128 sword and how it works on a 64-bit processor. Compiler Crab explains the magic behind u128 and i128 swords, the use ...
The text provides a deep-dive into Rust's HashMap, explaining its efficient SIMD-friendly design based on Google's SwissTable. It compares the traditional compsci-101 hashtable with Rust's HashMap, highlighting the differences and...
The text is about CPU performance optimization. It discusses data-centric design, hyper-threading, padding data to natural boundaries, hardware pre-fetch, data types, memory alignment, branching, stack-allocated data, loop iterati...
The text discusses the concept of transparent software, which is software that the user can see through and understand. The author provides examples of transparent software and explains why it is important. He also discusses the b...
The text describes the author's experience using the Android ChatGPT app on vacation to translate menus, identify art, and learn about wine. It highlights the app's visual abilities and how it enhanced the author's exploration and...
The text discusses the concept of AI hallucinations, which are reasonable suggestions made by AI chatbots based on patterns and data. It argues that these hallucinations should be taken seriously as suggestions for improvement, ra...
The text explains the process of allocating memory in Rust using vec![0u8; 1024]. It delves into the details of how the memory is allocated, the role of the allocator, and the process of zeroing the memory. It also discusses the i...
The text discusses how to create Rust objects that survive program restart by using Systemd's File Descriptor Store, memfd_create syscall, and Rust's Allocator trait. It explains how to write an allocator backed by persistent memo...
The text discusses the importance of epoll for modern applications, particularly when structured around an event loop or async engines like Go or Rust's Tokio. It highlights the various file descriptors that can be managed using e...
Rust returns values based on the System V AMD64 ABI, using specific registers for different data types. A single integer or pointer goes in `rax`, while a second value or larger integers are placed in `rdx`. Returning structs foll...
The text discusses the Two Sum problem, highlighting the trade-offs between brute force and optimized approaches, as well as the use of SIMD techniques to enhance performance for larger datasets. It also emphasizes the importance ...
The text discusses the cost of sync::Once in Rust, which runs initialization code exactly once, even when called concurrently from multiple threads. The author analyzes the source code for call_once and explains the cost of the fu...
The text discusses the importance of using the right data type in Rust programming. It explains how using smaller types can save memory and improve program performance. It also highlights the differences in memory usage and perfor...
The text discusses the Underrust series, which will look at Rust’s assembly output and answer questions about Rust's performance and optimizations. It also provides a template for examining the assembly output of a Rust program an...
The text discusses the process of making an x86_64 Linux Rust binary as small as possible, comparing it to a pure assembly program. It details the steps taken to reduce the size of the binary, including removing symbols, making ea...
The text discusses how Linux, macOS, and other operating systems use Address Space Layout Randomization (ASLR) for security, allowing the use of a local stack variable's address to generate a pseudo-random number. It explains the ...
The text discusses return value optimization in Rust, specifically how the address of a struct doesn't move and is created in its final resting place on the main's stack. It explains the process stack in memory and the assembly ou...
The text explains Rust's atomic memory Ordering and how it compiles to assembly on x86 tigerlake machine. It discusses the read-modify-write operations, the C++ standards committee, compiler re-ordering, and the explanation of ato...

0Rust is also C

2022-01-17

Rust offers modern features like hash maps, growable arrays, and a UTF-8 string type, simplifying programming compared to C++. It allows for almost direct translation of C code, improves upon C by eliminating the need to pass arra...
The text discusses the importance of epoll, a Linux feature, in handling network requests on the Internet. It explains how epoll revolutionized the handling of thousands of concurrent connections and significantly lowered operatio...
The text is a guide on how to script a Minecraft server with Python. It includes the basic server setup, running the Minecraft server, adding the API, starting Minecraft more permanently, connecting and whitelisting, and coding on...
The text provides tips for improving the performance of Rust programs on Linux, including identifying CPU bottlenecks, optimizing release mode, compiling for the target CPU, finding hotspots with flamegraphs, and using faster data...