Skip to content

runtime/race: MemoryRangeSet is slow #20139

Closed
@josharian

Description

@josharian

The race-enabled compiler (go install -race cmd/compile) spends 40% of its CPU time in __tsan MemoryRangeSet. Looking at the implementation of MemoryRangeSet in tsan_rtl.cc, I see (roughly):

if (kGoMode || size < 64*1024) {
    // Go pointer by pointer.
  } else {
    // Do a bulk clear.
  }

The compiler does lots of large, bulk memory clears. I wonder whether the kGoMode || part of the conditional could be removed.

cc @dvyukov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions