If const char * is used instead of string_view, the size could be reduced by a lot but still may be a bit more than the first approach.In addition:
If const char * is used instead of string_view, the size could be reduced by a lot but still may be a bit more than the first approach.
Adding more enum entries resulted in Second Approach consuming lesser than First Approach.
For e{gcc12.g here: here Second Approach consumes 96 bytes with const char * and more enum entries VS the case with1 + O3}
166 bytes of First Approach vs string_view. Which is a dramatic improvement perhaps unless I did something wrong?
Is this one way of determining96 bytes of Second Approach
(#bytes are calculated at the performance of functions?bottom comments)
So with more enum entries, does the Second Approach outperform the First Approach?
Is this one way of determining the performance of functions?