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

Unecessary allocations in HashSet<T> #138

Open
jnyrup opened this issue Jul 19, 2023 · 7 comments
Open

Unecessary allocations in HashSet<T> #138

jnyrup opened this issue Jul 19, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@jnyrup
Copy link
Contributor

jnyrup commented Jul 19, 2023

Description

HashSet<T> contains three calls to string.Format in non-invariant checking methods.

Logger.Log(string.Format(string.Format("Expand to {0} bits", bits + 1)));

Logger.Log(string.Format(string.Format("Resize to {0} bits", bits)));

Logger.Log(string.Format(string.Format("Resize to {0} bits done", bits)));

Even though Logger.Log per default sends any string into void, this still results in some unnecessary string allocations.

Solution

I would suggest deleting those lines or hide them behind #if DEBUG

Describe alternatives you've considered

Additional context

@jnyrup jnyrup added the enhancement New feature or request label Jul 19, 2023
@sestoft
Copy link
Owner

sestoft commented Jul 20, 2023 via email

@jnyrup
Copy link
Contributor Author

jnyrup commented Jul 22, 2023

Hej Peter

Det kunne jeg godt være interesseret i.
For en god ordens skyld skal jeg lige have clearet det med min arbejdsgiver.
De rette skal lige have afsluttet deres sommerferier, men jeg vender tilbage, når jeg har et svar.

@jnyrup
Copy link
Contributor Author

jnyrup commented Aug 25, 2023

Hej Peter og Rasmus

Så har jeg fået afklaring og jeg vil gerne hjælpe til med vedligeholdelsen af C5.

@dlidstrom
Copy link

Det ser ut som att dokumentationen har genererats felaktigt. Kanske du kan ta en titt på det också?

@jnyrup
Copy link
Contributor Author

jnyrup commented Aug 28, 2023

@dlidstrom opret venligst et separat GH issue til dette, det gør det meget lettere at holde styr på.

@sestoft
Copy link
Owner

sestoft commented Oct 12, 2023 via email

@dlidstrom
Copy link

Vad hände sen? Jag letar efter dokumentationen men hittar den inte längre.

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

No branches or pull requests

3 participants