Click here to Skip to main content
16,006,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List control events Pin
jhorstkamp11-May-04 8:13
jhorstkamp11-May-04 8:13 
GeneralRe: List control events Pin
Diddy26-May-04 2:46
Diddy26-May-04 2:46 
QuestionHow to make code block works faster? Pin
Kolich11-May-04 2:41
Kolich11-May-04 2:41 
AnswerRe: How to make code block works faster? Pin
Nitron11-May-04 2:56
Nitron11-May-04 2:56 
GeneralRe: How to make code block works faster? Pin
Kolich11-May-04 3:01
Kolich11-May-04 3:01 
GeneralRe: How to make code block works faster? Pin
Nitron11-May-04 3:09
Nitron11-May-04 3:09 
GeneralRe: How to make code block works faster? Pin
Kolich11-May-04 3:14
Kolich11-May-04 3:14 
GeneralRe: How to make code block works faster? Pin
Nitron11-May-04 3:26
Nitron11-May-04 3:26 
Kolich wrote:
This block processing takes 3/4 of all code time.

OMG | :OMG: no way! (unless your total processing time is like 0.000012 seconds). How long is your processing time? How many elements in your matrix? Here is the disassembly for my test block:

	if (a > 0) 
00411ADE  mov         eax,dword ptr [a] 
00411AE1  cmp         dword ptr [eax],0 
00411AE4  jle         test+48h (411B08h) 
		if (a > 255) 
00411AE6  mov         eax,dword ptr [a] 
00411AE9  cmp         dword ptr [eax],0FFh 
00411AEF  jle         test+3Ch (411AFCh) 
			b = 255;
00411AF1  mov         eax,dword ptr [b] 
00411AF4  mov         dword ptr [eax],0FFh 
		else b = a;
00411AFA  jmp         test+46h (411B06h) 
00411AFC  mov         eax,dword ptr [b] 
00411AFF  mov         ecx,dword ptr [a] 
00411B02  mov         edx,dword ptr [ecx] 
00411B04  mov         dword ptr [eax],edx 
	else b = 0;
00411B06  jmp         test+51h (411B11h) 
00411B08  mov         eax,dword ptr [b] 
00411B0B  mov         dword ptr [eax],0 


that's like 16 instructions! It probably takes more just to instantiate one of your matrix objects...



~Nitron.
ññòòïðïðB A
start

GeneralRe: How to make code block works faster? Pin
Kolich11-May-04 3:33
Kolich11-May-04 3:33 
GeneralRe: How to make code block works faster? Pin
toxcct11-May-04 4:51
toxcct11-May-04 4:51 
GeneralRe: How to make code block works faster? Pin
Nitron11-May-04 5:00
Nitron11-May-04 5:00 
GeneralRe: How to make code block works faster? Pin
toxcct11-May-04 5:03
toxcct11-May-04 5:03 
GeneralRe: How to make code block works faster? Pin
Nitron11-May-04 5:09
Nitron11-May-04 5:09 
GeneralRe: How to make code block works faster? Pin
toxcct11-May-04 5:14
toxcct11-May-04 5:14 
GeneralRe: How to make code block works faster? Pin
Nitron11-May-04 5:16
Nitron11-May-04 5:16 
AnswerRe: How to make code block works faster? Pin
gUrM33T11-May-04 3:02
gUrM33T11-May-04 3:02 
GeneralRe: How to make code block works faster? Pin
Kolich11-May-04 3:05
Kolich11-May-04 3:05 
GeneralRe: How to make code block works faster? Pin
gUrM33T11-May-04 3:15
gUrM33T11-May-04 3:15 
GeneralRe: How to make code block works faster? Pin
gUrM33T11-May-04 3:23
gUrM33T11-May-04 3:23 
GeneralRe: How to make code block works faster? Pin
Kolich11-May-04 3:24
Kolich11-May-04 3:24 
GeneralRe: How to make code block works faster? Pin
toxcct11-May-04 4:59
toxcct11-May-04 4:59 
AnswerRe: How to make code block works faster? Pin
David Crow11-May-04 3:15
David Crow11-May-04 3:15 
GeneralRe: How to make code block works faster? Pin
Tim Smith11-May-04 3:44
Tim Smith11-May-04 3:44 
AnswerRe: How to make code block works faster? Pin
Diddy11-May-04 3:24
Diddy11-May-04 3:24 
GeneralRe: How to make code block works faster? Pin
Kolich11-May-04 3:28
Kolich11-May-04 3:28 

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.