Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77237

Using an enum based switch statement will perform considerably slower than with an integer value based one

    XMLWordPrintable

Details

    • 53bece0812207e52b3368434c8174976b10e2aa8 81ac3bd856e7c6ead21fc2efc34cdf52cd9196b1

    Description

      Using an enum based switch statement will perform considerably slower than with an integer value based one. When clicking on the button in the example the result will be something like:

      loopConstant: 8ms
      loopVar: 18ms
      loopEnum: 2381ms
      

      indicating that the enum switch is taking much more time to process than would be expected.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            andysh Andy Shaw
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes