Consider to replace ActivatedJob struct to interface
rhzs opened this issue · 2 comments
Hi,
Passing heavy object passing during service task execution ActivatedJob
is caught by Go Critic linter https://go-critic.com/overview.html#hugeParam-ref
This suggests performance will degrade over time. I don't have benchmark yet how degraded. Maybe if we have 10,000 service tasks in one flow, this will start to degrade.
Can we consider passing function interface
or pointer
? My suggestion is to change the existing struct copying with function interface
passing. We can do better mocking as well when function interface
is passed.
Hi @rhzs
thank you very much for spotting this.
Your comment makes totally sense to me and I consider/plan changing it as you suggested
Feel free to fill a PR - I would be very happy.
Besides that ... would you please guide me for a second, how could I run the go critic linter on my own?
Is there a link?
@nitram509 MR raised in #42
I can make separate MR to introduce Golang linter by using Golang CI Linter.
Thank you