✻ ~/blog
주로 기술, 가끔 그 언저리.Mostly tech, and what turns up around it.
개발자 최석원의 노트입니다. 대부분 기술 이야기이고, 일하다 생긴 잡다한 것도 올립니다. 모든 글은 한국어와 영어로 함께 씁니다.Notes by Seokwon Choi, developer. Mostly technical, plus whatever else comes up along the way. Every post is written in both Korean and English.
Glob(~/blog/*/{ko,en}.mdx)
글 12편, 모두 한국어와 영어로12 posts, each in Korean and English
Bash
2026년의 글posts
블로그 둘러보기: 다이어그램, 수식, 코드A tour of this blog: diagrams, math, code
첫 글입니다. 이 블로그가 글 안에 담을 수 있는 것을 하나씩 보여 드립니다. 읽는 자리를 따라오는 그림, 빌드할 때 그리는 다이어그램, 수식, 코드, 그리고 두 언어.
The first post. Everything this blog can put inside a post, one thing at a time: a figure that follows your place, diagrams drawn at build time, math, code, and two languages.
Redis 7.2.16 내부: 쓰기 한 건에서 장애 조치까지Redis 7.2.16 internals: from one write to failover
명령 실행과 자료구조에서 시작해 복제, Sentinel의 투표, Cluster 장애 조치와 슬롯 이동을 소스 함수까지 따라갑니다. 응답을 잃은 MIGRATE, 메모리 축출, Pub/Sub와 ACL도 같은 서버 안에서 연결합니다.
Follow source functions from command execution and data structures through replication, Sentinel voting, Cluster failover and slot migration. Connect lost MIGRATE replies, eviction, Pub/Sub and ACL inside the same server.
2024년의 글posts
터미널에서 한글은 왜 두 칸인가Why Hangul takes two columns in a terminal
한글 한 글자가 영문 두 칸을 차지하는 이유, 화살표와 상자 문자의 폭이 환경마다 다른 이유, 그리고 문자열 길이로 칸을 세면 안 되는 이유.
Why one Hangul syllable is as wide as two Latin letters, why arrows and box-drawing characters change width from one setup to the next, and why string length is not a column count.
CPython 3.11의 powersort: list.sort가 바꾼 병합 순서Powersort in CPython 3.11: the merge order list.sort changed
Python 3.11에서 list.sort의 run 병합 규칙이 timsort의 스택 불변식에서 powersort의 경계 power로 바뀌었습니다. 무엇이 달라졌는지 코드로 따라가고, 3.10과 3.11에서 비교 횟수와 시간을 직접 재 봤습니다. 무작위 입력에서는 차이가 없고, 길이가 고르지 않은 run에서만 차이가 납니다.
In Python 3.11 the rule that decides which runs list.sort merges switched from timsort's stack invariants to powersort's boundary powers. This post walks through what changed in code and measures comparison counts and time on 3.10 and 3.11. Random input does not move at all; only runs of uneven length do.
Redis HyperLogLog: 100만 명을 14KB로 세기Redis HyperLogLog: counting a million users in 14 KB
고유 방문자를 SET으로 세면 100만 명에 48MB, HyperLogLog로 세면 14KB입니다. 어떻게 세는지 따라가 보고, 오차가 얼마인지 직접 재 봤습니다.
Counting unique visitors with a SET takes 48 MB for a million; HyperLogLog takes 14 KB. How it counts, and how far off it is, measured.
Go 1.22 루프 변수: 고쳐진 버그와 go.mod 한 줄Go 1.22 loop variables: the fixed bug and one line of go.mod
Go 1.22부터 for 루프 변수는 반복마다 새로 만들어집니다. 그런데 어느 의미가 적용될지는 툴체인이 아니라 go.mod의 go 줄이 정하고, go run main.go는 그 줄을 보지 않습니다. 두 툴체인으로 직접 확인하고, 주소를 넘기는 루프의 할당이 2개에서 102개로 느는 것까지 재 봤습니다.
Since Go 1.22, for-loop variables are created fresh on every iteration. But the go line in go.mod, not the toolchain, decides which semantics apply, and go run main.go never reads that line. I checked both toolchains, and measured a loop that leaks addresses going from 2 to 102 allocations.
2023년의 글posts
Redis listpack: 512번째 필드와 513번째 필드 사이Redis listpack: between field 512 and field 513
Redis 7에서 작은 hash, set, zset은 listpack 하나에 통째로 들어갑니다. 임계값 한 칸 차이로 메모리가 세 배 뛰고, 한번 바뀐 인코딩은 돌아오지 않으며, 임계값을 올리면 조회가 선형 탐색이 됩니다. Redis 7.2에서 직접 쟀습니다.
In Redis 7, small hashes, sets and zsets live in a single listpack. One step past the threshold triples memory, a converted encoding never comes back, and raising the threshold turns lookups into a linear scan. Measured on Redis 7.2.
Cuckoo filter는 정말 Bloom filter보다 나은가Is a cuckoo filter really better than a Bloom filter?
Cuckoo filter 논문의 부제는 Practically Better Than Bloom입니다. 버킷 크기별 적재율, 같은 공간에서의 오탐률, 삭제가 실제로 어떻게 동작하는지 직접 구현해 재 보니 '항상'은 아니었습니다.
The cuckoo filter paper is subtitled Practically Better Than Bloom. Implementing both and measuring load factor by bucket size, false-positive rate at equal space, and deletion shows it is not always true.
Jump Consistent Hash: 메모리 없이 다섯 줄로 하는 일관된 해싱Jump Consistent Hash: consistent hashing in five lines and no memory
버킷을 10개에서 11개로 늘릴 때 mod-N은 키의 91%를 옮기고, Jump Consistent Hash는 9.1%만 옮깁니다. 링도 테이블도 없이 어떻게 그게 되는지 따라가 보고, 해시 링과 나란히 재 봤습니다.
Growing from 10 to 11 buckets, mod-N moves 91% of keys and Jump Consistent Hash moves 9.1%. How it does that with no ring and no table, measured next to a hash ring.
2022년의 글posts
sort()를 부르면 실제로 도는 것: C++, Rust, Go의 퀵소트What actually runs when you call sort(): quicksort in C++, Rust and Go
교과서의 퀵소트는 이미 정렬된 배열에서 O(n²)이 됩니다. 그래서 C++, Rust, Go의 표준 라이브러리는 아무도 교과서 퀵소트를 쓰지 않습니다. libstdc++의 introsort, Rust와 Go 1.19의 pdqsort, 그리고 세 언어의 안정 정렬이 각각 어떤 입력을 어떻게 막는지 움직이는 그림으로 따라가 봤습니다.
Textbook quicksort goes quadratic on an already sorted array, so none of the C++, Rust or Go standard libraries ship it. This post follows libstdc++'s introsort, the pdqsort in Rust and Go 1.19, and the three stable sorts, with animations showing which input each one defends against and how.
Skip list: 동전 던지기에서 Redis의 순위표까지Skip lists: from coin flips to Redis rankings
높은 노드 몇 개로 검색을 줄이는 구조가 Redis에서는 순위를 세고, LevelDB에서는 쓰는 동안 읽히는 메모리 인덱스가 됩니다. 검색 경로와 span을 직접 바꾸고, 논문과 실제 구현이 어디서 갈라지는지 따라갑니다.
A few tall nodes shorten a search. Redis adds rank accounting; LevelDB turns the structure into a memory index that can be read during writes. Change the paths and spans, then follow where the papers and production implementations diverge.