Skip to content

cmd/compile: avoid unnecessary map value copy when using "_, ok := m[k]" #75398

@moshe-samson

Description

@moshe-samson

This issue is a placeholder for a potential compiler optimization.

Currently, in Go, when doing:

_, ok := m[k] 

The compiler still copies m[k] into a temporary value before discarding it, even though the value is not used. This may result in performance overhead when the map value type is large.

This issue is to track discussion on whether the compiler could safely optimize away the value copy in this case.

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions