Closed dzmitry-lahoda closed 3 weeks ago
If you're worried about performance, you should be able to use cfg
in your Debug
implementation to make it a no-op in production. Is there a reason that doesn't work?
I guess yes, this is workaround. So it will not allow to read behavior out of struct definition.
Also, workaround does not guarant redb
does not creates some temporal structures which are compiled away without being created just for Debug.
Debug is poor man json serde kind of, it should be optional feat of redb, like redb could have optional support of some serde kinds of for example.
I decided not to add support in redb
for serde. You can find the reasoning in past issues, such as this one: https://github.com/cberner/redb/pull/805
I would like to avoid Debug in our production code, only in test, so Debug for sure does not slows performance.
Debug is optional feature.