Closed Megidd closed 1 year ago
It's intentional in so far as it was programmed, but it's undesirable behavior. That's not the sort of thing you want in an init() routine.
Thanks @deadsy :slightly_smiling_face:
Does it make sense to prepare a PR to implement the following?
init
function.parallel
.init
function into the new parallel
function.parallel
execution is finished, the goroutines are terminated.parallel
function whenever the actual logic is called.Does it make sense to prepare a PR to implement the following?
Yes. The threads should be setup when the render is called. I would say that the number of threads should probably be >= the number of CPU cores. I think the typical peak performance is reached when there are plenty of potential threads to schedule against the CPUs.
SDFX package starts empty routines even though it is not used. It means just importing the package itself opens up some threads by the
init
method. Is it the intended behavior?https://github.com/deadsy/sdfx/blob/81635b49281851b9c85332e30c8ffe6c695ddb68/render/march3.go#L52