golang/go

runtime: consider using batched shuffle in selectgo

Open

#68,933 建立於 2024年8月18日

在 GitHub 查看
 (8 留言) (0 反應) (1 負責人)Go (19,008 fork)batch import
NeedsInvestigationPerformancecompiler/runtimehelp wanted

倉庫指標

Star
 (133,883 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

This is a minor optimization opportunity. runtime.selectgo typically does a shuffle of a fairly small number of channels. https://lemire.me/blog/2024/08/17/faster-random-integer-generation-with-batching/ introduces an optimization for such shuffles. It might be worth incorporating the technique into selectgo. (math/rand/v2 is probably not possible due to backwards compat.)

貢獻者指南