(no title)
koyote | 1 month ago
The function was something like:
int ReturnAnswerIfCharIsValid(char* c)
{
if(c == nullptr)
throw std::exception("ERROR!");
return 42;
}
The exception line was changed to something like: throw std::exception("Char is not valid, please fix it!"); // String is now longer
The performance of this hot-path function went down the drain.I fixed it by replacing the exception call with yet another function call:
if(c == nullptr)
ThrowException();
Other fixes might have included something like __forceinline in the function signature.
hinkley|1 month ago