<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">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="">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 face="Courier New" class="">Benchmark Mode Cnt Score Error Units</font></div><div class=""><font face="Courier New" class="">TestEnhancedSwitch.testEnhancedSwitch thrpt 5 30789.482 ± 17667.365 ops/s</font></div><div class=""><font face="Courier New" class="">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></body></html>