I suspect if you wrote a small real world parser you would find a negligible performance difference.
I’ll look for one on GitHub. > On Mar 19, 2025, at 3:24 PM, Mike Schinkel <m...@newclarity.net> wrote: > > >> >> On Mar 19, 2025, at 1:55 PM, Ian Lance Taylor <i...@golang.org> wrote: >> >>> On Wed, Mar 19, 2025 at 10:43 AM Mike Schinkel <m...@newclarity.net> wrote: >>> >>> Given these benchmark results, would the Go team reconsider such a language >>> feature on a basis of performance vs. a comparison of syntax to bring if >>> statement performance closer to that of switch statements? The current >>> disparity means developers must choose between the awkward single-case >>> syntax of switch statements and the more natural control flow of if >>> statements, often sacrificing either readability or performance. >>> >>> I understand Go's philosophy of keeping the language small and orthogonal, >>> but this seems like a case where a targeted language feature could improve >>> performance for use-cases that needs it, or at least make the gaining that >>> performance much less awkward. >> >> It's very unusual for Go to adopt language changes for performance >> reasons. In fact, nothing comes to mind. Language changes are made to >> improve expressibility and readability. Where performance is >> important, we prefer to address it using tooling or library functions. > > Okay, thank you for considering and replying. > > -Mike > P.S. The proposed change would improve expressibility and readability too, > but I digress. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion visit > https://groups.google.com/d/msgid/golang-nuts/87033509-CD21-4C98-A4F7-8C18F76ADFF5%40newclarity.net. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/587E9636-C022-4322-88AD-93E455EC15B3%40ix.netcom.com.