Skip to content
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

Improved performance a little with generics #7

Merged
merged 2 commits into from
Sep 23, 2023
Merged

Conversation

DrBlury
Copy link
Contributor

@DrBlury DrBlury commented Sep 23, 2023

No description provided.

@Mxrk
Copy link
Contributor

Mxrk commented Sep 23, 2023

Using generics should indeed be faster:
https://github.com/ugurcsen/gods-generic#testing-and-benchmarking

@jinyus jinyus merged commit dfcbb56 into jinyus:main Sep 23, 2023
@jinyus
Copy link
Owner

jinyus commented Sep 23, 2023

Thanks,
PS: the call to Clear is not needed because I limit the size of the heap and it's is being drained on every iteration.

@Mxrk
Copy link
Contributor

Mxrk commented Sep 23, 2023

https://github.com/jinyus/related_post_gen/blob/5b242fc36629e32504a9a97b14641a84c374f1f7/go/main.go#L55C2-L55C62

On reddit you said this is making a difference for you, is this still the case?
(placing it before or inside the loop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants