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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:00:16+00:00 2026-05-31T13:00:16+00:00

On Visual Studio 2010, when I enable enhanced instruction sets on the following code,

  • 0

On Visual Studio 2010, when I enable enhanced instruction sets on the following code, the execution time is actually increased.

void add(float * input1, float * input2, float * output, int size)
{
    for(int iter = 0; iter < size; iter++)
    {
        output[iter] = input1[iter] * input2[iter];
    }
}

int main()
{

    const int SIZE = 10000000;
    float *in1 = new float[SIZE];
    float *in2 = new float[SIZE];
    float *out = new float[SIZE];
    for(int iter = 0; iter < SIZE; iter++)
    {
        in1[iter] = std::rand();
        in2[iter] = std::rand();
        out[iter] = std::rand();
    }
    clock_t start = clock();
    for(int iter = 0; iter < 100; iter++)
    {
        add(in1, in2, out, SIZE);
    }
    clock_t end = clock();
    double time = difftime(end,start)/(double)CLOCKS_PER_SEC;

    system("PAUSE");
    return 0;
}

I am consistently getting about 2.0 seconds for time variable with SSE2 enabled, but about 1.7 seconds when it is “Not Set”. I am building on Windows 7 64bit, VS 2010 professional, Release configuration, Optimize for speed.

Is there any explanation for why enabling SSE causes longer execution time?

  • 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-31T13:00:17+00:00Added an answer on May 31, 2026 at 1:00 pm

    There is an overhead in SSE code for moving values into and from the SSE registers, which may outweigh the performance benefits of SSE if you are only doing very few, simple calculations as is the case with your example.

    Also note that this overhead becomes significantly larger if your data is not 16-byte aligned.

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

Sidebar

Related Questions

Running Visual Studio 2008 Professional it is possible to enable static code analysis using
I'm using Visual Studio 2010, and in my C++/CLI project there are two Code
Can someone explain the following behaviour (I'm using Visual Studio 2010). header: #pragma once
Is there any way to tell Visual Studio 2010 to enable syntax highlighting for
When I try to compile the following C++ program using the Visual Studio 2010
I've read articles that explain how to enable Visual Studio 2010 managed extensions to
Visual Studio 2010 offers a lot of comfortable tools for unit testing via its
Visual Studio 2010 RC -> Silverlight Application We have a library of images that
Since Visual Studio 2010 is slated for release in March of 2010 and HTML
In Visual Studio 2010 Beta 2 I created a new navigation Silverlight application. Without

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.