-
Notifications
You must be signed in to change notification settings - Fork 125
perf(namekey): Remove superfluous AsciiString allocations for name key lookups #1959
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
base: main
Are you sure you want to change the base?
Conversation
…ons, misc formatting tweaks
| #include "Common/AsciiString.h" | ||
|
|
||
| //------------------------------------------------------------------------------------------------- | ||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason why removing /**? A quick search yields its applied over 9,000 in the code. Do we want to fix it everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am in favor of replacing all block comments with inline comments. It caused syntax coloring issues in Visual Studio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a task for that.
Skyaero42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all good to me
| void load( Int textureSize ); ///< load images | ||
|
|
||
| const Image *findImageByName( const AsciiString& name ); ///< find image based on name | ||
| const Image *findImageByName( const AsciiString& name ) const; ///< find image based on name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks wrong in isolation. Would make first commit fail compile.
Merge with Rebase
This change removes superfluous
AsciiStringallocations for name key lookups. It was applied by hand. It is split into 2 commits for a cleaner file diff.It cuts many allocations and can help loading and runtime performance a bit.
Adjacent to Name Key, some functions that did Name Key lookups and do not necessarily need to be given an
AsciiStringhave been given a new function overload takingconst char*.The identified and affected functions are:
There are probably plenty more functions of this kind but this change is already large enough as is and this seemed to be all directly related to Name Key things.
TODO