cmd/link: memory reductions slowed down the linker #31898
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
CL 173938, which switched to using mmap'd symbol name strings, made the linker 15% slower. Based on the profile, the reason appears to be completely silly: the new call to
r.rd.Offset()
inobjReader.readSymName
is remarkably expensive. TheSeek
call used to find the offset is roughly 20% of the profile.@cherrymui suggested we could make
bio.Reader
directly use the mmap'ed backing store when we have it and simply track its own offset. We should also avoid theOffset
call if we don't have the mmap'ed backing store, since we don't need it then.Alternatively, we could continue using the underlying file, but track the offset ourselves in
bio.Reader
./cc @thanm @cherrymui
The text was updated successfully, but these errors were encountered: