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
I've got code that use eaopt.GA to generate the solution for a problem, and the quality of the result is ok.
My Genome struct is a wrapper around a pair of (potentially) huge slices, and this is creating an important pressure on the GC, which has a lot to do to manage them. It's taking more than 60% of the execution time of my program dixit pprof, which is probably optimizable.
One way to optimize would be using a sync.Pool to re-use the struct, like this (many parts omitted for simplicity's sake):
The issue is that there isn't anything that allow me to put the Genome back into the pool when it's not used anymore.
I would suggest adding a Release method to the eaopt.Genome interface that would allow releasing resources, like puting the struct back into the pool or anything else.
Any advice on this would be appreciated.
The text was updated successfully, but these errors were encountered:
I've got code that use eaopt.GA to generate the solution for a problem, and the quality of the result is ok.
My Genome struct is a wrapper around a pair of (potentially) huge slices, and this is creating an important pressure on the GC, which has a lot to do to manage them. It's taking more than 60% of the execution time of my program dixit pprof, which is probably optimizable.
One way to optimize would be using a sync.Pool to re-use the struct, like this (many parts omitted for simplicity's sake):
The issue is that there isn't anything that allow me to put the Genome back into the pool when it's not used anymore.
I would suggest adding a
Release
method to theeaopt.Genome
interface that would allow releasing resources, like puting the struct back into the pool or anything else.Any advice on this would be appreciated.
The text was updated successfully, but these errors were encountered: