Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7611399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:39:36+00:00 2026-05-31T01:39:36+00:00

PMD suggested in my GWT project that I should change my switch to multiple

  • 0

PMD suggested in my GWT project that I should change my switch to multiple ifs if it has fewer than 3 branches. I know that this is compiled to Javascript, but I wondered if it made any difference in GWT. Do you think the generated Javascript is more efficient with if’s compared to switch? Does the current GWT compiler (2.4) do any optimisation on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:39:37+00:00Added an answer on May 31, 2026 at 1:39 am

    According to this site: http://oreilly.com/server-administration/excerpts/even-faster-websites/writing-efficient-javascript.html#the_switch_statement found via this answer: https://stackoverflow.com/a/2923007/66416 It does matter:

    In JavaScript, if statements are generally faster than switch
    statements when there are just one or two conditions to be evaluated.

    A quick scan of a compiled GWT 2.4 file found no replacements of ‘small’ switch statements into if statements. So it actually might be a useful suggestion of PMD.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We know that PMD is integrated with eclipse. And i want to customize it.
Which static analysis tools for Java has easiest extension mechanism. I checked PMD But
PMD has a rule called ArrayIsStoredDirectly in the Sun Security ruleset: Constructors and methods
Guys, I wanted generate the pmd report while building the project so I have
PMD has a way to ignore particular warning with //NOPMD comment inside Java source
I wish to add a PMD check to ensure that a class does not
I have just installed PMD to analyze my Java project. Really nice tool, highly
Does anyone of you know any code reviewing tool designed for JSF like PMD/Checkstyle
I need to use System.exit(0) in an application. Eclipse has the PMD plugin installed
I'm using PMD to generate some code quality report on a project. I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.