pingcap/tidb

Proposal to use atomic.Pointer[T] instead of atomic.Value

Open

#44,736 建立於 2023年6月16日

在 GitHub 查看
 (6 留言) (0 反應) (1 負責人)Go (6,186 fork)batch import
good first issuetype/enhancement

倉庫指標

Star
 (40,090 star)
PR 合併指標
 (平均合併 14天 4小時) (30 天內合併 346 個 PR)

描述

Enhancement

Currently, the usage of atomic.Value is prevalent in our codebase. However, I would like to propose using atomic.Pointer[T] instead. The reason being that atomic.Pointer[T] provides a clearer expression of the type, which can help in reducing type conversions.

Therefore, I suggest that we consider using atomic.Pointer[T] in our codebase wherever possible. This change will not only result in better code clarity but also improve the performance of our code.

貢獻者指南