Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can handle dateandtime control value for different regional language? Pin
Luc Pattyn14-Mar-11 0:13
sitebuilderLuc Pattyn14-Mar-11 0:13 
GeneralRe: How can handle dateandtime control value for different regional language? [modified] Pin
Le@rner14-Mar-11 1:18
Le@rner14-Mar-11 1:18 
GeneralRe: How can handle dateandtime control value for different regional language? Pin
Luc Pattyn14-Mar-11 1:35
sitebuilderLuc Pattyn14-Mar-11 1:35 
GeneralRe: How can handle dateandtime control value for different regional language? Pin
Le@rner14-Mar-11 18:22
Le@rner14-Mar-11 18:22 
QuestionRe: How can handle dateandtime control value for different regional language? [modified] Pin
David Crow15-Mar-11 8:41
David Crow15-Mar-11 8:41 
AnswerRe: How can handle dateandtime control value for different regional language? Pin
Le@rner15-Mar-11 18:30
Le@rner15-Mar-11 18:30 
GeneralRe: How can handle dateandtime control value for different regional language? Pin
David Crow16-Mar-11 2:34
David Crow16-Mar-11 2:34 
QuestionIs there any licenced data structure library Pin
pandit8413-Mar-11 19:53
pandit8413-Mar-11 19:53 
AnswerRe: Is there any licenced data structure library Pin
Richard MacCutchan13-Mar-11 22:56
mveRichard MacCutchan13-Mar-11 22:56 
AnswerRe: Is there any licenced data structure library Pin
Hans Dietrich13-Mar-11 22:58
mentorHans Dietrich13-Mar-11 22:58 
QuestionDisable turning the screen off Pin
aangerma12-Mar-11 22:57
aangerma12-Mar-11 22:57 
AnswerRe: Disable turning the screen off Pin
Hans Dietrich12-Mar-11 23:49
mentorHans Dietrich12-Mar-11 23:49 
AnswerRe: Disable turning the screen off Pin
Eddy Vluggen13-Mar-11 3:30
professionalEddy Vluggen13-Mar-11 3:30 
GeneralRe: Disable turning the screen off Pin
aangerma13-Mar-11 3:48
aangerma13-Mar-11 3:48 
AnswerRe: Disable turning the screen off Pin
Emilio Garavaglia13-Mar-11 10:10
Emilio Garavaglia13-Mar-11 10:10 
GeneralRe: Disable turning the screen off Pin
aangerma13-Mar-11 22:49
aangerma13-Mar-11 22:49 
GeneralRe: Disable turning the screen off Pin
Maximilien14-Mar-11 2:49
Maximilien14-Mar-11 2:49 
Questionit's much slower when using boost::pool_allocator and boost::object_pool Pin
followait12-Mar-11 19:05
followait12-Mar-11 19:05 
AnswerRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
Richard MacCutchan12-Mar-11 22:45
mveRichard MacCutchan12-Mar-11 22:45 
GeneralRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
CPallini13-Mar-11 1:44
mveCPallini13-Mar-11 1:44 
GeneralRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
Richard MacCutchan13-Mar-11 2:06
mveRichard MacCutchan13-Mar-11 2:06 
GeneralRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
CPallini13-Mar-11 3:02
mveCPallini13-Mar-11 3:02 
GeneralRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
followait13-Mar-11 1:55
followait13-Mar-11 1:55 
GeneralRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
Richard MacCutchan13-Mar-11 2:09
mveRichard MacCutchan13-Mar-11 2:09 
AnswerRe: it's much slower when using boost::pool_allocator and boost::object_pool Pin
Stefan_Lang22-Mar-11 0:20
Stefan_Lang22-Mar-11 0:20 
Sorry for being late to reply, but since there doesn't seem to be a useful answer yet I thought I'd add some explanations.

Looking at your code, the results you got from test0() and test(1) look ok, but those from test2() and test(3) are probably useless: std::vector has it's own method of maintaining a buffer for cases of repeated resizing, which is very similar to the one used in boost::pool. Thus it will not allocate memory once per loop, in fact there will probably only be a few dozen allocations forwarded to the boost::pool allocator. If you want to ensure one allocation per loop count, then I suggest you use std::list instead.

I am not quite sure why object_pool is so slow, but I suspect the reason is the method free(). This method, to my knowledge, is disabled for pools of standard objects, because it is very inefficient (it is O(n) where n is the number of objects in the pool). The standard memory allocator (i. e. new/delete)), although quite slow, is still only O(1)! Therefore, the only sensible way to use boost::object_pool at this time is to not call the destroy() method at all! Don't worry, the moment the pool gets destroyed, all the objects will still be destructed properly, but that will be much more efficient than destroying each object individually.

I've tried to use boost::pool 2 years ago for our application, but, in similar tests, found that it wasn't usable for our purposes. I eventually created my own implementation that dynamically frees (and destructs) objects at O(1), and considerably faster than new/delete (tested for up to 10 million allocations). If that's what you're looking for, I could make this into an article. It might take some time though.

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.