Click here to Skip to main content
16,011,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Two dimensional array Pin
Michael Dunn19-Sep-02 7:53
sitebuilderMichael Dunn19-Sep-02 7:53 
GeneralRe: Two dimensional array Pin
valikac19-Sep-02 10:00
valikac19-Sep-02 10:00 
Generalmemory mapped file Pin
User 988519-Sep-02 6:43
User 988519-Sep-02 6:43 
GeneralRe: memory mapped file Pin
valikac19-Sep-02 10:06
valikac19-Sep-02 10:06 
GeneralRe: memory mapped file Pin
Neville Franks19-Sep-02 11:27
Neville Franks19-Sep-02 11:27 
GeneralRe: memory mapped file Pin
User 988519-Sep-02 15:35
User 988519-Sep-02 15:35 
GeneralRe: memory mapped file Pin
Neville Franks20-Sep-02 11:07
Neville Franks20-Sep-02 11:07 
GeneralRe: memory mapped file Pin
User 988520-Sep-02 12:11
User 988520-Sep-02 12:11 
I did a sample profiling program:

The results:

Scenario a: [map - update - unmap] in a loop - 60 us per iteration
Scenario b: map - [update in a loop] - unmap - 40 ns per update

If the update is done on two memory locations in the view more than 4 KB apart, the time in the first case goes up to 80 us.

To confirm this, I added a FlushViewofFile in the scenario b loop and the time was 11 ms!.


Now I have to draw my conclusions.

- mapping and unmapping are not that bad, if they are inevitable.
- if you can map the whole file to memory, then do it. it gives best performance
- Limit the number of FlushViewofFile calls to what is absolutely necessary.



Thomas

modified 29-Aug-18 21:01pm.

GeneralRe: memory mapped file Pin
Neville Franks20-Sep-02 12:23
Neville Franks20-Sep-02 12:23 
GeneralAssigning character string to LPCWSTR Pin
abhinarulkar19-Sep-02 6:32
abhinarulkar19-Sep-02 6:32 
GeneralRe: Assigning character string to LPCWSTR Pin
dabs19-Sep-02 6:40
dabs19-Sep-02 6:40 
GeneralRegisterClass problem Pin
saekth19-Sep-02 6:30
saekth19-Sep-02 6:30 
GeneralRe: RegisterClass problem Pin
Joaquín M López Muñoz19-Sep-02 9:14
Joaquín M López Muñoz19-Sep-02 9:14 
GeneralC++ And Getting Images Off The Web Pin
OpenGL19-Sep-02 5:24
OpenGL19-Sep-02 5:24 
GeneralRe: C++ And Getting Images Off The Web Pin
jmkhael19-Sep-02 5:38
jmkhael19-Sep-02 5:38 
GeneralRe: C++ And Getting Images Off The Web Pin
Michael Dunn19-Sep-02 5:36
sitebuilderMichael Dunn19-Sep-02 5:36 
GeneralRe: C++ And Getting Images Off The Web Pin
TyMatthews19-Sep-02 5:48
TyMatthews19-Sep-02 5:48 
GeneralRe: C++ And Getting Images Off The Web Pin
OpenGL19-Sep-02 6:47
OpenGL19-Sep-02 6:47 
GeneralRe: C++ And Getting Images Off The Web Pin
OpenGL19-Sep-02 6:50
OpenGL19-Sep-02 6:50 
GeneralRe: C++ And Getting Images Off The Web Pin
OpenGL19-Sep-02 8:53
OpenGL19-Sep-02 8:53 
GeneralSysAllocString doesnt compile Pin
ns19-Sep-02 5:18
ns19-Sep-02 5:18 
GeneralRe: SysAllocString doesnt compile Pin
Jason Henderson19-Sep-02 5:26
Jason Henderson19-Sep-02 5:26 
GeneralRe: SysAllocString doesnt compile Pin
jmkhael19-Sep-02 5:29
jmkhael19-Sep-02 5:29 
GeneralRe: SysAllocString doesnt compile Pin
ns19-Sep-02 6:09
ns19-Sep-02 6:09 
GeneralRe: SysAllocString doesnt compile Pin
Steve S19-Sep-02 6:15
Steve S19-Sep-02 6:15 

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.