Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7568 Discussions

why the performance is so low when using pointer checker ?

sun__lei
Beginner
335 Views

why the performance is so low when using pointer checker?

There two two compiler parameters:

1. CFLAGS= -O0 -check-pointers:rw

2. CFLAGS= -O0 

Questions:

1. why the former is five fast than the second?

2. how does the pointer checker work? Check on every buf or only check on buf[16]

char *buf = malloc(16); for (int i=0; i<=16; i++) { buf = ‘A’ + i; }

3. when I change the "for loop"  using  SIMD and width of 4,  how many times  does the point cheker do check?

 

0 Kudos
5 Replies
RahulV_intel
Moderator
335 Views

Hi,

1. Pointer checker adds overhead in terms of the size and execution time of a program. Hence, the performance is low because the execution time is high. Ideally, pointer checker is designed for use only during application testing and debugging and not during deployment.

For questions 2 and 3, we need to check with the Subject Matter Experts(SMEs) and we'll get back to you at the earliest.

 

--Rahul

jimdempseyatthecove
Black Belt
335 Views

To answer your curiosity, place a debugger break point on the line of interest and then at break, open a Dissassembly view.

Or when compiling, choose to output: Assembly with Source Code (/FAs). Do this (to different files) for with and without pointer check.

Then compare both outputs.

The VTune data will also show what and where things are going on (in Dissassembly window).

Jim Dempsey

Viet_H_Intel
Moderator
335 Views

When memory is allocated for that pointer, its upper and lower bound will be saved in a "bound table". Every time you access it, it will be checked against upper and lower bounds. So, #2 should be buf  and #3 should be 4 times fewer.

Viet_H_Intel
Moderator
173 Views

Let us know if this is still an issue. Otherwise, we will close it.


Thanks,


Viet_H_Intel
Moderator
160 Views

We will no longer respond to this thread.  

If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.

Thank


Reply