|
I've tested the two mechanisms several times fairly.
23 files, 2.05GB
When not using file mapping it takes about 250s.
Otherwise, it takes about 150s.
And your theory explains why sometimes it is slow and some times it is fast randomly.
|
|
|
|
|
followait wrote: And I'm going to use the file mapping mechanism, will it be much faster?
PS: The size per file is about 100MB, and total size in one directory is about 1GB.
If you read the whole of the file into memory at once, file mapping isn't much faster in my experience. Best thing to do is abstract the file accessing mechanism into a separate class or module, so you can change it without impacting the rest of your code. Then you can try both methods and do some objective measurement - that's the best way to tell which approach is better for your scenario.
|
|
|
|
|
I've tested the two mechanisms several times fairly.
23 files, 2.05GB
When not using file mapping it takes about 250s.
Otherwise, it takes about 150s.
|
|
|
|
|
followait wrote: When not using file mapping it takes about 250s.
Otherwise, it takes about 150s.
Tells you all you need to know
The most I've file-mapped is ~ 1GB. But that was in a single file...on a PC with 1GB RAM. Obviously, i couldn't just map all of it at once, so I ended up writing a custom STL iterator (using the splendid Boost.Iterator[^] library) that would map parts of the file in and out (thank you, MapViewOfFile [^]) as I navigated through the file.
Worked really nicely and with little to no performance hit - I was processing that sucker with standard STL algorithms (e.g. binary_search to find a particular artefact) and it felt FAST...
|
|
|
|
|
Hi all,
I need win32 API to close any window(ex:IE) forcibly.Lets take one scenario.
Steps:
1.Install toolbar(Yahoo/Google)
2.Open IE.
3.Close IE.// Here unless until we are closing toolbar popup window we can't close browser window.
But I need API to close browser window without interacting with toolbar window.
Thanks...
|
|
|
|
|
You can use PostQuitMessage API to tell the window to close.
If you want to force a close you can use TerminateProcess to kill the process.
But does not guarantee proper cleanup.
«_Superman_»
|
|
|
|
|
You can send WM_CLOSE to programs.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I have tried with WM_CLOSE, but it is not working.Better if sending the code.
|
|
|
|
|
You need to get handle of programs(HWND) and then you can use of SendMessage for close them.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
FYI: In widows task manager we are able to 'End Task' any application.I read one article, it was written to use EndTask() API to close any app forcibly. But my compiler is flashing error.I think it doesn't exit in VS2008 express edition.
|
|
|
|
|
What was the error?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi, I wish to start upon writing a data recovery program, How do I start it? What are the resource I need to know? Does anyone have experience in doing it? Thanks
|
|
|
|
|
that would really depend on the source of the data - where/what is your data ?
'g'
|
|
|
|
|
basically it is deleted file in windows NTFS, FAT32 FAT16.And maybe linux too. Is it possible? Any one experience on it?
|
|
|
|
|
We have an application that prints multiple documents at one time. The user is presented with dialog box containing a 'Cancel' button. The application's api does not return whether or not the cancel button has been pressed, and we need to determine if the user has cancelled the job.
Currently, we are polling the print jobs in the printer queue. This method has proven to be unreliable, since a small job may get cancelled and cleared from the queue in between polls.
Since my knowledge of C++ is limited (I am primarily a C# coder), I can only assume that the application makes use of callback (SetAbortProc(), AbortProc()). I would like to know when the callback occurs. Any ideas on how this can be done?
Thanks for your help!
|
|
|
|
|
Hi Friends,
I have a strange problem. I have a dialog based program and I Create a modeless CPropertySheet with 5 CPropertypage in it. and in the main Dialog box i have some buttons. when selecting a menu option i change size of the PropertySheet.
Now Issues are
I align the buttons in the dialog box with the property page. It looks ok on some Windows XP versions, but the Page looks more expanded in some other versions (like Chinese, Korean or japanese) and the Buttons aligned along it goes outside the main dialog.
The other issue is
when i compile the program in Multi Byte it looks OK. but If I compile the same program in UNICODE the color of the CPropertyPage turns white and looks different.
For the First issue, I kind of found the cause. That is the size of the CPropertypage is calculated according to the font set on it and as that font differs in some version of OS the size calculated become wrong and the display is screwed up. But I am clue less about how to resolve it.
Can some one help me with these?
P.Somasundaram
|
|
|
|
|
Hi,
I have the same problem with the size of the property pages. For Japanese the pages became longer than the dialog, so I resized the dialog to 1.2 times the original size and it looked okay. But for chinese, the property pages were made smaller, so the graphics were cut off. I dont know yet how to resolve it.
Did you ever find out a better solution that works for all OS?
Thanks,
Kalyan
|
|
|
|
|
Hi,
I am trying out the following code .
setlocale(LC_ALL ,"");
std::string ab = "名前を入力してください: " ;
cout.imbue(std::locale("Japanese_Japan.932"));
cout<<ab<<endl;
printf("%s" ,ab.c_str());
Both system and user locale are set to japanese.
Cout statement doesnt print the message in screen.
I am able to print message using printf .
how can i use cout to print japanese meesages ?
Thanks in advance
|
|
|
|
|
shouldn't you use std::wstring ?
|
|
|
|
|
Maximilien wrote: shouldn't you use std::wstring
No. His encoding is Shift_JIS (CP 932) and that's multibyte, not wide char.
|
|
|
|
|
Nemanja Trifunovic wrote: No. His encoding is Shift_JIS (CP 932) an
No. Her* encoding is...
*Deepa = female
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I should know you're only interested in female's questions.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Wait... Weren't you the same guy who accused me of having a general hatred towards women?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Yes.
Your memory is too strong, pal.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Your memory is too strong, pal.
Mr. Nic Rowan shares his opinion[^] with you.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|