Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
 
Thread Tools  Search this thread 
goodbyte
January 27, 2007 12:06 AM PST
Problems with inlining array constructors
I am having some performance issues with constructors for array elements, and wonder if there is any easy fix I've missed. I have made following test case:

#include <xmmintrin.h>

union sse_t {
  __m128 ps;
  float f;

  inline sse_t() {}
  inline sse_t(__m128 x): ps(x) {}
};

struct sse_soa_t {
#if 1
  sse_t t[3];
#else
  sse_t a, b, c;
#endif // 0
};


int main(int argc, const char *argp) {
  sse_soa_t x;
  return 0;
}



When compiled with -O2 -ip -ipo on a P4 with icpcbin (ICC) 9.1 20061103 I can see a call to __cxa_vec_ctor in the assembly output, but if "#if 1" is changed to "#if 0" all references to sse_soa_t is optimized out. __cxa_vec_ctor invokes the sse_t::sse_t() constructor through a function pointer, and this kills performance in my application. Is there any easy way around this?
Jennifer Jiang (Intel)
Total Points: 5930
Status Points: 5430
Brown Belt
January 31, 2007 5:31 PM PST
Rate
 
#1

We're aware of this issue. It's been worked on. Right now there's no work around yet.

If you'd like to be notified on when the fix will be available for this issue, please file a ticket at https://premier.intel.com.

Thanks,

Jennifer

magnus@nuedge.net
June 22, 2008 2:16 PM PDT
Rate
 
#2 Reply to #1
Hi there. I am experiencing the exact same problem (at least with the Mac version of ICC). I was quite taken by surprise when I discovered that, in the application I am developing, almost 40% of the CPU load is spent constructing arrays with objects that have empty constructors.

Any idea when this will be fixed?

Until it is fixed, I guess I will need to write some ugly workaround (like allocating a char array of sufficient size and cast to the object-array pointer).

Forum Statistics

4474 users have contributed to 23996 threads and 69823 posts to date.
In the past 24 hours, we have 38 new thread(s) 119 new posts(s), and 163 new user(s).

In the past 3 days, the most popular thread for everyone has been Catastrophic error The most posts were made to Why does my .exe only use 50-80% CPU when executing? The post with the most views is You can report them here if

Please welcome our newest member Udaysimha Mysore (Intel)