Click here to Skip to main content
15,917,795 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: How is BitBlt implemented Pin
DQNOK16-Nov-07 3:46
professionalDQNOK16-Nov-07 3:46 
GeneralRe: How is BitBlt implemented Pin
Luc Pattyn16-Nov-07 3:55
sitebuilderLuc Pattyn16-Nov-07 3:55 
GeneralRe: How is BitBlt implemented Pin
Force Code16-Nov-07 7:49
Force Code16-Nov-07 7:49 
GeneralRe: How is BitBlt implemented Pin
Luc Pattyn16-Nov-07 8:27
sitebuilderLuc Pattyn16-Nov-07 8:27 
GeneralRe: How is BitBlt implemented Pin
Skippums16-Nov-07 9:02
Skippums16-Nov-07 9:02 
GeneralRe: How is BitBlt implemented Pin
Force Code16-Nov-07 9:59
Force Code16-Nov-07 9:59 
GeneralRe: How is BitBlt implemented Pin
Jheriko++17-Nov-07 17:18
Jheriko++17-Nov-07 17:18 
GeneralRe: How is BitBlt implemented Pin
Alan Balkany29-Nov-07 4:46
Alan Balkany29-Nov-07 4:46 
I noticed several optimizations that may speed up your algorithm:

1. In the innermost loop, you're recomputing (x&y) even though they don't change for different z values. If you assign (x&y) to a temporary variable before the z loop, it will save time.

2. Computing the address for ROP[x][y][z] every iteration wastes time. If you set a pointer to the first element (ROP[0][0][0]), it can be incremented in one instruction to point to the next element to store your result. This is faster than the several arithmetic operations needed to access an element in a 3D array.

Your second case does this 3D-element-address calculation twice each iteration, and takes the most time.

3. You might try making z a register variable.

4. It's been claimed that ++x is faster than x++ because the pre-incremented value isn't needed.

5. The slow performance in the third case is surprising. One thing you could try to bypass memcpy is the #asm directive to include in-line assembly language to copy the memory block.

Hope this helps...
GeneralRe: How is BitBlt implemented Pin
Mark Churchill19-Nov-07 14:58
Mark Churchill19-Nov-07 14:58 
GeneralRe: How is BitBlt implemented Pin
Force Code19-Nov-07 20:24
Force Code19-Nov-07 20:24 
AnswerRe: How is BitBlt implemented Pin
Chris Losinger19-Nov-07 4:36
professionalChris Losinger19-Nov-07 4:36 
AnswerRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 5:04
El Corazon20-Nov-07 5:04 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 6:14
Force Code20-Nov-07 6:14 
GeneralRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 6:30
El Corazon20-Nov-07 6:30 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 7:05
Force Code20-Nov-07 7:05 
GeneralRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 7:12
El Corazon20-Nov-07 7:12 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 7:35
Force Code20-Nov-07 7:35 
GeneralRe: How is BitBlt implemented Pin
El Corazon20-Nov-07 7:50
El Corazon20-Nov-07 7:50 
GeneralRe: How is BitBlt implemented Pin
Force Code20-Nov-07 8:07
Force Code20-Nov-07 8:07 
GeneralRe: How is BitBlt implemented Pin
Dexterus29-Nov-07 4:18
Dexterus29-Nov-07 4:18 
AnswerRe: How is BitBlt implemented Pin
The Nightcoder27-Nov-07 11:47
The Nightcoder27-Nov-07 11:47 
QuestionAny one know c4.5 Pin
ibnoe13-Nov-07 14:27
ibnoe13-Nov-07 14:27 
GeneralRe: Any one know c4.5 Pin
John_Adams10-Dec-07 23:36
John_Adams10-Dec-07 23:36 
QuestionSplitting a Polygon into Rectangles Pin
notacake12-Nov-07 3:02
notacake12-Nov-07 3:02 
AnswerRe: Splitting a Polygon into Rectangles Pin
Luc Pattyn12-Nov-07 4:19
sitebuilderLuc Pattyn12-Nov-07 4: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.