Pattern matching switch perf regression compared to if chains

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: tools

      In a test case like this, where Block is a non-sealed interface:

      Block b = ...
      switch(b) {
          case ABlock _ -> ...
      ... // With many other cases

      When the code is executed with polymorphic block types, in the end, pattern matching switch is slower than if-chain of instanceof or if-chain on the getClass result.

            Assignee:
            Chen Liang
            Reporter:
            Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: