This document summarizes a PR that improves the performance of non-blocking receives on empty closed channels in Golang. It begins with the PR title, discusses how channels normally work in Golang including their circular queue mechanism and blocking behavior. It then explains how the PR speeds up the performance by checking if the channel is empty and closed before locking, avoiding the overhead of locking in that case. Finally, it mentions running benchmarks and profiles to analyze the performance improvement.
2. Agenda
● A PR title : runtime: speed up receive
on empty closed channel
● How channel work
● How the PR do to improve performance
● Analysis
3. A PR title : runtime: speed up receive
on empty closed channel
4. runtime: speed up receive on empty closed channel
Currently, nonblocking receive on an open channel is about
700 times faster than nonblocking receive on a closed channel.
This change makes closed channels equally fast.