Skip to content

Switch the pre22 warning to use CopyOnWriteArraySet.#23976

Merged
zhangskz merged 1 commit into25.xfrom
cp-25-pre22-warn-fix
Oct 14, 2025
Merged

Switch the pre22 warning to use CopyOnWriteArraySet.#23976
zhangskz merged 1 commit into25.xfrom
cp-25-pre22-warn-fix

Conversation

@zhangskz
Copy link
Copy Markdown
Member

This data structure is better for cases where writes are rare and reads common. When this warning path is it, the writes only occur exactly once per CVE-affected type, and reads occur once per every parse of those types.

Broadly people sensitive by this performance concern should really regen their gencode, but this should help take the edge off of people who first upgrade to 4.x and then look to incrementally regen any ancient gencode.

Fixes #23963

PiperOrigin-RevId: 819238880

Cherry-pick of c131253

This data structure is better for cases where writes are rare and reads common. When this warning path is it, the writes only occur exactly once per CVE-affected type, and reads occur once per every parse of those types.

Broadly people sensitive by this performance concern should really regen their gencode, but this should help take the edge off of people who first upgrade to 4.x and then look to incrementally regen any ancient gencode.

Fixes #23963

PiperOrigin-RevId: 819238880
@zhangskz zhangskz requested a review from a team as a code owner October 14, 2025 19:44
@zhangskz zhangskz requested review from esrauchg and googleberg and removed request for a team October 14, 2025 19:44
@zhangskz zhangskz enabled auto-merge (squash) October 14, 2025 19:44
@zhangskz zhangskz merged commit 9822fb5 into 25.x Oct 14, 2025
156 checks passed
@zhangskz zhangskz deleted the cp-25-pre22-warn-fix branch October 14, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants