Replace sync.Mutex with Sync.Map
createProtoLibraryTargetsForIncludeDirs uses a lock-protected plain map to see if a directory has been handled previously during concurrent visits of modules in bp2build. From golang's docs https://pkg.go.dev/sync#Map, replacing sync.Mutex with sync.Map will be faster in this use case since the keys (directores here) are written just once but read many times. Test: m bp2build Change-Id: Ia2a471b4db5d2890fa6048bc05a17cebc5f686af
Loading
Please register or sign in to comment