go(algo): close chans after use
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-08-05 17:23:10 +02:00
parent c4077a449d
commit 8262416e2d
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -143,6 +143,8 @@ funcCount := len(bench.Functions)
// ch serves as a way to get the actual computed output.
ch := make(chan []stats.Stats, funcCount)
defer close(ch)
for i := range algoStats {
// ng y'all.
go RandomSearchNG(10000, 30, bench.Dimensions, bench.FuncNames[i], ch)
@ -158,6 +160,9 @@ funcCount := len(bench.Functions)
pCh := make(chan report.PicList, funcCount*len(bench.Dimensions))
pMeanCh := make(chan report.PicList, funcCount*len(bench.Dimensions))
defer close(pCh)
defer close(pMeanCh)
for i := range algoStats {
go plotAllDims(algoStats[i], "plot", ".svg", pCh, pMeanCh)
}
@ -197,6 +202,8 @@ funcCount := len(bench.Functions)
// ch serves as a way to get the actual computed output.
ch := make(chan []stats.Stats, funcCount)
defer close(ch)
for i := range algoStats {
// params:
// maxFES, benchMinIters, neighbours int,
@ -216,6 +223,9 @@ funcCount := len(bench.Functions)
pCh := make(chan report.PicList, funcCount*len(bench.Dimensions))
pMeanCh := make(chan report.PicList, funcCount*len(bench.Dimensions))
defer close(pCh)
defer close(pMeanCh)
for _, algoStat := range algoStats {
go plotAllDims(algoStat, "plot", ".svg", pCh, pMeanCh)
}