You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing bc8afe7 I noticed that the tests were creating and leaking thousands of goroutines, even though Pigosat as a whole uses very few go calls. I tracked it down to this: newMinimizer creates args as m.args = make(chan arguments, 2). I think the channel fills up and goroutines are blocking on send to the channel.
Maybe this is a more general problem. Using a go call in Minimize is a bit overkill. Instead of adding a Join or Wait method to the Minimizer interface that blocks until all calls to RecordSolution have completed and having Minimize call it before returning, just don't use goroutines at all. Generally, RecordSolution will do nothing more than append to a slice or write to a channel. This is not the real speed bottleneck in the code.
Remove use of go in Minimize
Remove requirement that RecordSolution be safe for parallel use
Replace use of channels in optimize_test with simple slices
The text was updated successfully, but these errors were encountered:
When testing bc8afe7 I noticed that the tests were creating and leaking thousands of goroutines, even though Pigosat as a whole uses very few
go
calls. I tracked it down to this:newMinimizer
createsargs
asm.args = make(chan arguments, 2)
. I think the channel fills up and goroutines are blocking on send to the channel.Maybe this is a more general problem. Using a
go
call in Minimize is a bit overkill. Instead of adding aJoin
orWait
method to the Minimizer interface that blocks until all calls toRecordSolution
have completed and having Minimize call it before returning, just don't use goroutines at all. Generally, RecordSolution will do nothing more than append to a slice or write to a channel. This is not the real speed bottleneck in the code.go
inMinimize
RecordSolution
be safe for parallel useoptimize_test
with simple slicesThe text was updated successfully, but these errors were encountered: