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

Allocations issue #6

Closed
cristeigabriel opened this issue Jan 23, 2021 · 1 comment
Closed

Allocations issue #6

cristeigabriel opened this issue Jan 23, 2021 · 1 comment

Comments

@cristeigabriel
Copy link
Contributor

PLEASE don't abuse std::string! Consider std::string_view or std::string, to see why, I recommend you try overloading the new operator and count every allocation, i personally prefer using const char* or std::string_view when I need a level of 'customizaiton' for strings, neither allocate to heap

For formatting I prefer to write a sprintf wrapper, so I avoid using libraries that create strings, the allocations cand end up being slower than C/posix functions very easily and should be avoided in our situation

I saw them used but I'm not certain whjere as it was from a superficial look where they were spammed

@cristeigabriel
Copy link
Contributor Author

this also includes to_string, it creates a string, obviously

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

No branches or pull requests

2 participants