-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: improve performance if the element of the Value of *Model does not implement the AfterFindable interface. #799
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days. |
This issue was closed because it has been stalled for 30+7 days with no activity. |
Hi @seedeed, Thank you for reporting this issue. I agree with you, the block could spend unnecessary resources. The block was recently touched with a new thing, and I opened a PR for your issue after that. The PR is #805, and the specific commit is 89774fa. Please take a look at the PR and/or the commit and give me feedback if the direction is the same as your idea, or please let me know your idea if you have another good way. Thanks in advance! |
Hi @seedeed |
Description
I found that the afterFind method of *Model would create a log of goroutines via *errgroup.Group.Go(...) even if the element of the Value of *Model does not implement the AfterFindable interface, which might cause a lot of unneeded CPU cost. To avoid this, I think we could move the AfterFindable interface checking out of the Go function. If this's really a problem, I think I could submit a PR to fix it.
pop/callbacks.go
Lines 32 to 43 in 17f09c0
Additional Information
No response
The text was updated successfully, but these errors were encountered: