We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version.String() currently returns every new string from buffer. Also, Version.Compare calles Version.String() internally.
When I should compare many Versions, every Compare func creates new string. It requires too many memories, and cases too heavy GC.
I propose result of Version.String() should be cached internally (like original). How do you think about?
The text was updated successfully, but these errors were encountered:
I think caching would double the leak when you have many instances and not just repeatedly calling String() on a single instance.
String()
Sorry, something went wrong.
I think the main problem is Compare doing v.String() == other.String()
Compare
v.String() == other.String()
I wonder if it would be more efficient if instead of segments []int64 there would be something like:
segments []int64
segment1 int64 segment2 int64 segment3 int64 segment4 int64 segment5 int64 segment6 int64 lenSegments int
then equality could be compared with v == other.
v == other
This would of course put a limit to how many segments you can have.
Actually, ARRAYS of comparable types are comparable. There could therefore be:
segments [maxSegments]int64 numSegments int
The struct would still be comparable with ==.
==
No branches or pull requests
Version.String() currently returns every new string from buffer.
Also, Version.Compare calles Version.String() internally.
When I should compare many Versions, every Compare func creates new string.
It requires too many memories, and cases too heavy GC.
I propose result of Version.String() should be cached internally (like original).
How do you think about?
The text was updated successfully, but these errors were encountered: