Click here to Skip to main content
15,896,912 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Extracting data from the webpages using MFC Pin
CPallini13-Oct-09 0:29
mveCPallini13-Oct-09 0:29 
GeneralRe: Extracting data from the webpages using MFC Pin
NaveenHS13-Oct-09 0:35
NaveenHS13-Oct-09 0:35 
GeneralRe: Extracting data from the webpages using MFC Pin
kilt13-Oct-09 2:12
kilt13-Oct-09 2:12 
GeneralRe: Extracting data from the webpages using MFC Pin
CPallini13-Oct-09 2:23
mveCPallini13-Oct-09 2:23 
GeneralRe: Extracting data from the webpages using MFC Pin
Richard MacCutchan13-Oct-09 3:12
mveRichard MacCutchan13-Oct-09 3:12 
GeneralRe: Extracting data from the webpages using MFC Pin
Iain Clarke, Warrior Programmer13-Oct-09 4:43
Iain Clarke, Warrior Programmer13-Oct-09 4:43 
GeneralRe: Extracting data from the webpages using MFC Pin
Rajesh R Subramanian13-Oct-09 4:46
professionalRajesh R Subramanian13-Oct-09 4:46 
AnswerRe: Extracting data from the webpages using MFC Pin
David Crow13-Oct-09 3:46
David Crow13-Oct-09 3:46 
GeneralRe: Extracting data from the webpages using MFC Pin
NaveenHS15-Oct-09 1:21
NaveenHS15-Oct-09 1:21 
AnswerRe: Extracting data from the webpages using MFC Pin
msn9213-Oct-09 14:50
msn9213-Oct-09 14:50 
QuestionLink error [modified] Pin
ratprita12-Oct-09 23:46
ratprita12-Oct-09 23:46 
QuestionRe: Link error Pin
CPallini13-Oct-09 0:11
mveCPallini13-Oct-09 0:11 
AnswerRe: Link error Pin
Cedric Moonen13-Oct-09 0:20
Cedric Moonen13-Oct-09 0:20 
Questionfast fast fast Pin
__erfan__12-Oct-09 22:43
__erfan__12-Oct-09 22:43 
AnswerRe: fast fast fast Pin
CPallini12-Oct-09 22:57
mveCPallini12-Oct-09 22:57 
GeneralRe: fast fast fast Pin
__erfan__12-Oct-09 23:09
__erfan__12-Oct-09 23:09 
GeneralRe: fast fast fast Pin
CPallini13-Oct-09 0:01
mveCPallini13-Oct-09 0:01 
AnswerRe: fast fast fast Pin
Rajesh R Subramanian12-Oct-09 23:05
professionalRajesh R Subramanian12-Oct-09 23:05 
GeneralRe: fast fast fast Pin
__erfan__12-Oct-09 23:12
__erfan__12-Oct-09 23:12 
AnswerRe: fast fast fast Pin
Rolf Kristensen13-Oct-09 0:07
Rolf Kristensen13-Oct-09 0:07 
You could consider doing 4 double operations in each for-loop. This would allow modern CPU's to perform the operation in parallel.

Taken from Software Optimization Guide for AMD64 Processors[^]:


Rationale and Examples
This is especially important to break long dependency chains into smaller executing units in floating-point code, whether it is mapped to x87, SSE, or SSE2 instructions, because of the longer latency of
floating-point operations. Because most languages (including ANSI C) guarantee that floating-point expressions are not reordered, compilers cannot usually perform such optimizations unless they offer a switch to allow noncompliant reordering of floating-point expressions according to algebraic rules.
Reordered code that is algebraically identical to the original code does not necessarily produce identical computational results due to the lack of associativity of floating-point operations. There are
well-known numerical considerations in applying these optimizations (consult a book on numerical analysis). In some cases, these optimizations may lead to unexpected results. In the vast majority of
cases, the final result differs only in the least-significant bits.

Listing 10. Avoid
double a[100], sum;
int i;
sum = 0.0f;
for (i = 0; i < 100; i++) {
   sum += a[i];
}


Listing 11. Preferred
double a[100], sum1, sum2, sum3, sum4, sum;
int i;
sum1 = 0.0;
sum2 = 0.0;
sum3 = 0.0;
sum4 = 0.0;
for (i = 0; i < 100; i + 4) {
   sum1 += a[i];
   sum2 += a[i+1];
   sum3 += a[i+2];
   sum4 += a[i+3];
}
sum = (sum4 + sum3) + (sum1 + sum2);


Notice that the four-way unrolling is chosen to exploit the four-stage fully pipelined floating-point adder. Each stage of the floating-point adder is occupied on every clock cycle, ensuring maximum sustained utilization.

JokeRe: fast fast fast Pin
CPallini13-Oct-09 0:14
mveCPallini13-Oct-09 0:14 
GeneralRe: fast fast fast Pin
__erfan__13-Oct-09 0:27
__erfan__13-Oct-09 0:27 
QuestionStored Procedure Pin
MsmVc12-Oct-09 22:14
MsmVc12-Oct-09 22:14 
AnswerRe: Stored Procedure Pin
Rajesh R Subramanian12-Oct-09 22:16
professionalRajesh R Subramanian12-Oct-09 22:16 
GeneralRe: Stored Procedure Pin
MsmVc12-Oct-09 22:19
MsmVc12-Oct-09 22:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.