explaingit

yanfeizhang/coder-kung-fu

6,785CAudience · developerComplexity · 1/5Setup · moderate

TLDR

A collection of deep-dive technical articles in Chinese about how CPUs, memory, disk, and networking work at the OS level, paired with runnable C experiments so you can verify each concept on your own Linux machine.

Mindmap

mindmap
  root((coder-kung-fu))
    Topics covered
      CPU internals
      Memory management
      Disk storage
      Networking
    Tech stack
      C experiments
      Linux kernel
    Use cases
      Performance tuning
      OS internals study
      Systems debugging
    Audience
      Intermediate devs
      Advanced devs
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Understand why your Linux server's memory access patterns affect performance by studying NUMA and CPU cache behavior

USE CASE 2

Learn how epoll enables a server to handle thousands of simultaneous connections without a thread per connection

USE CASE 3

Run C benchmark experiments to measure the actual cost of context switches and interrupts on your machine

USE CASE 4

Tune TCP connection limits correctly by understanding what resources each connection consumes in the kernel

Tech stack

CLinux

Getting it running

Difficulty · moderate Time to first run · 1h+

Articles and all linked content are in Chinese, a Linux environment is required to compile and run the C experiments.

In plain English

This repository is a curated collection of technical articles written in Chinese about how computers work at a low level. The author, who goes by the pen name Fei Ge, focuses on four main areas: CPU internals, memory management, disk storage, and networking. The goal is to help software developers build a deeper understanding of the hardware and operating system behaviors that affect the performance of the code they write every day. The articles cover topics like how the Linux kernel creates and schedules processes, how memory allocation actually works under the hood, why random memory access is slower than sequential access, how TCP connections are established and what resources each connection consumes, and how tools like epoll allow a server to handle many network connections at once without spinning up a thread for each one. Each topic is explained with diagrams and, in many cases, working C code experiments that let readers verify the behavior themselves. The repository also includes companion C source files for some of the experiments, so readers can run the tests on their own machines. There are also links to two books the author published: one on Linux process and memory internals, and one on Linux networking. Both books reportedly became bestsellers in the technical computing category on the day they launched in China. The project is aimed at intermediate to advanced developers who already write production software and want to understand why their programs behave the way they do at the system level. Topics like NUMA memory architecture, context switch overhead, interrupt cost, and network buffer tuning are the kind of material covered. The README is written entirely in Chinese, and all linked articles point to the WeChat public platform, so a Chinese reading environment is needed to access the full content.

Copy-paste prompts

Prompt 1
I want to run the coder-kung-fu C experiment that demonstrates why random memory access is slower than sequential access. Show me how to compile and run it on Linux and explain the output.
Prompt 2
Based on the coder-kung-fu networking articles, write a minimal C program that uses epoll to handle 1000 simultaneous TCP connections on a Linux server without blocking.
Prompt 3
Help me write a C benchmark inspired by the coder-kung-fu articles that measures context switch overhead on my Linux machine and explains what the numbers mean for my server's performance.
Prompt 4
I want to understand NUMA memory architecture from the coder-kung-fu series. Write a C program that allocates memory on the wrong NUMA node and measures the performance penalty.
Open on GitHub → Explain another repo

← yanfeizhang on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.