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 6384329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:45:46+00:00 2026-05-25T02:45:46+00:00

hi i am building a large application using codeigniter . because the application is

  • 0

hi i am building a large application using codeigniter . because the application is very large , performance is a must . i want to optimize my if else statements .

is there is difference of performance using
from

if(false)   and    if(0)

if(true)   and    if(1)

what is the efficient way ?

and when using logical operators is their any sequence that optimize the performance

from if((a & b) || c) and if(c || (a & b) )

what is the efficient way ? or those two are the same ?

and from

if(a && b) and if(a & b)

what is the efficient way ?

and from

if(a || b) and  if(a | b)

what is the efficient way ?

is there any performance difference between if(a || b) and if((a || b))
note that 2 nd if is in two additional parentheses

please help me ……………………………..
thanks in advance.

  • 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-25T02:45:46+00:00Added an answer on May 25, 2026 at 2:45 am

    This is also known as “micro-optimization”, and generally frowned upon. The difference is hardly measurable at all. If you can shave off 50% of your if “calculation” time (which is a lot for optimization) you will end up with exactly no difference in the end product, unless your code is only if’s and nothing else. Making 1 query, file operation or even a loop/foreach a tiny bit quicker would make more difference. Write your ifs for readability, not for “speed”.

    Last but not least: for every performance-based change you need to MEASURE. Do isolated and repeated tests to find out what is quicker.

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

Sidebar

Related Questions

I'm building a web application (using prototype) that requires the addition of large chunks
we are currently building our first large application with Silverlight 4 (using PRISM) and
I have been building a JSF application using JPA to access the DB. There
I'm building a somewhat large application using kohana 3.1. I'm trying to set module-wide
I am building my first Java application using GWT which must read in data
I believe strongly in using unit-tests as part of building large multi-platform applications. We
I'm building a fairly large enterprise application made in python that on its first
I'm building a quite large Flex application as our administration tools and I need
For a large web application I'm building, I need to create an extensive user
I'm looking at building a Rails application which will have some pretty large tables

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.