<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Yes, the current translation is deliberately unoptimized, and in
    fact, the most recent version has some translation issues that make
    it accidentally worse as well (such as some unnecessary boxing.) 
    These are currently being worked on.  <br>
    <br>
    <div class="moz-cite-prefix">On 8/10/2022 6:04 AM, Jordan Zimmerman
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:D4C8E4D0-3FEB-4F4B-A863-0B44CFC0B13F@jordanzimmerman.com">
      
      Hi Folks,
      <div class=""><br class="">
      </div>
      <div class="">I've been experimenting with Pattern Matching for
        switch (Third Preview). I noticed that the performance of these
        enhanced switches is far worse than manual matching. Is this due
        to this only being a preview and optimizations have yet to be
        done? Anyway, I thought I'd mention what I found as an FYI.</div>
      <div class=""><br class="">
      </div>
      <div class="">Here's the jmh benchmark I used:</div>
      <div class=""><span class="Apple-tab-span" style="white-space:pre">     </span></div>
      <div class=""><span class="Apple-tab-span" style="white-space:pre">     </span><a href="https://gist.github.com/Randgalt/a68ceee62cd8127431cbe6e7afbfdf44" class="moz-txt-link-freetext" moz-do-not-send="true">https://gist.github.com/Randgalt/a68ceee62cd8127431cbe6e7afbfdf44</a></div>
      <div class=""><br class="">
      </div>
      <div class="">Here are the results:</div>
      <div class=""><br class="">
      </div>
      <div class="">
        <div class=""><font class="" face="Courier New">Benchmark      
                                    Mode  Cnt      Score       Error
             Units</font></div>
        <div class=""><font class="" face="Courier New">TestEnhancedSwitch.testEnhancedSwitch
             thrpt    5  30789.482 ± 17667.365  ops/s</font></div>
        <div class=""><font class="" face="Courier New">TestEnhancedSwitch.testManualSwitch
               thrpt    5  44651.612 ±  5135.641  ops/s</font></div>
      </div>
      <div class=""><br class="">
      </div>
      <div class="">Cheers.</div>
      <div class=""><br class="">
      </div>
      <div class="">-Jordan</div>
    </blockquote>
    <br>
  </body>
</html>