theolivenbaum commented on issue #346:
URL: https://github.com/apache/lucenenet/issues/346#issuecomment-711047250
@NightOwl888 : here is the proposed change for this case: https://github.com/apache/lucenenet/pull/372
Would it be fine to just remove this overload of Debugging.Assert completely?
I've the impression this is probably happening in many other places in the codebase.
On a quick glance, there are > 300 usages of this method, and I think it is only truly
save the allocation of a string when running with Debugging.Assert = true.

We could also change to use something similar to how [ZLogger](https://github.com/Cysharp/ZLogger)
implemented the zero allocation methods, by just having a couple of different overloads of
Debugging.Assert with generic parameter types, and a call to string.Format()
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
|