Skip to main content
Tweeted twitter.com/StackCodeReview/status/1554889848502177792
added 39 characters in body
Source Link
xyf
  • 508
  • 3
  • 13

In additionHowever, doing the following resulted in Second Approach consuming lesser bytes than the First:

  • 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.

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.

However, doing the following resulted in Second Approach consuming lesser bytes than the First:

  • If const char * is used instead of string_view

  • Adding more enum entries

added 39 characters in body
Source Link
xyf
  • 508
  • 3
  • 13

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?

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.

For e.g here: here Second Approach consumes 96 bytes with const char * and more enum entries VS the case with string_view. Which is a dramatic improvement perhaps unless I did something wrong?

Is this one way of determining the performance of functions?

So with more enum entries, does the Second Approach outperform 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.

{gcc12.1 + O3} 166 bytes of First Approach vs 96 bytes of Second Approach (#bytes are calculated at the 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?

added 90 characters in body
Source Link
xyf
  • 508
  • 3
  • 13

So with more enum entries, does the Second Approach outperform the First Approach?

So with more enum entries, does the Second Approach outperform the First Approach?

added 202 characters in body
Source Link
xyf
  • 508
  • 3
  • 13
Loading
added 771 characters in body
Source Link
xyf
  • 508
  • 3
  • 13
Loading
added 41 characters in body
Source Link
xyf
  • 508
  • 3
  • 13
Loading
added 135 characters in body
Source Link
xyf
  • 508
  • 3
  • 13
Loading
added 4 characters in body
Source Link
xyf
  • 508
  • 3
  • 13
Loading
Source Link
xyf
  • 508
  • 3
  • 13
Loading