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

  • Home
  • SEARCH
  • 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 6675683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:53:22+00:00 2026-05-26T03:53:22+00:00

I have been reading a lot of articles lately about programming practice, design and

  • 0

I have been reading a lot of articles lately about programming practice, design and so forth and was curious about the real performance gains from implementing multiplication as bit shifting.

The example I was reading about was encouraging implementing x*320 as (x<<8 + x<<6) for a commonly used routine.

How relevant is this in modern compilers? If there are significant performance gains, can compilers not automatically convert these “easy multiplications” to bit-shifts as necessary?

Has anyone had to resort to bit-shifting in this way in their projects to achieve faster multiplication? What performance gains can you expect?

  • 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-26T03:53:23+00:00Added an answer on May 26, 2026 at 3:53 am

    Yes, compilers will do most of these for you. They’re pretty aggressive with it too. So there’s rarely a need to do it yourself. (especially at the cost of readability)

    However, on modern machines now, multiplication isn’t “that” much slower than shifts. So any number that needs more than like 2 shifts are better done using multiplication. The compilers know this and will choose accordingly.

    EDIT:

    From my experience, I’ve never been able to outdo a compiler in this area unless the code was vectorized via SSE intrinsics (which the compilers don’t really try to optimize).

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

Sidebar

Related Questions

I have been reading a lot on design patterns lately and some of them
Lately I have been reading a lot of blog topics about big sites(facebook, twitter,
I have been reading a lot about Reinforcement Learning lately, and I have found
So lately I've been reading a lot of article about how concurrent programming is
I have been reading a lot about Haskell lately, and the benefits that it
I have been reading about Factory pattern a lot lately. I am trying to
I have been reading a lot of Javascript lately and I have been noticing
I have been reading a lot about C++ casting and I am starting to
I have been reading through the C++ FAQ and was curious about the friend
I've been reading up a lot about transactional memory lately. There is a bit

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.