Closed alexbereznikov closed 3 weeks ago
Good catch. I guess it would be more standard to move the string interpolation deeper as other libraries do it. public static void ENSURE(bool conditional, string message, params object[] args)
@ltetak Sure I thought about that, but profiling says that most of the time was lost in BasePage.ToString()
and I'm not quite sure how to avoid calculating it when passing via args
@ltetak Actually this .ToString()
call is redundant as formatter will call it either way. So it should work in the way you proposed, pushed fixed code, please take a look
@alexbereznikov I am not an owner of this repo. But this looks like a great performance improvement without any risks or side effects. cc: @mbdavid
LGTM! Thanks for your contribution!
String interpolation on hot paths leads to performance degradation. We need these messages only when error happened. With #2453 applied this gives 3x performance boost.
This partially fixes #2451