Is this worthy of an article?
-
To improve performance due to excessive new and delete operations on a a few classes, I created a template base class that provides object pooling for any class that publically inherits it. It just overrides the new and delete operators. Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. :) Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Go for it! It sounds interesting indeed. Not sure if I have any use for it, but it sounds like a good read. Please do write an article! :) -- Nicotine free: day 3
-
To improve performance due to excessive new and delete operations on a a few classes, I created a template base class that provides object pooling for any class that publically inherits it. It just overrides the new and delete operators. Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. :) Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Thomas George wrote: Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. IMHO, absolutely. I don't know that I have ever read anything on this (I have heard of it, I just haven't seen it in action). Besides, what's the worst thing that can happen? :) -Nick Parker
-
To improve performance due to excessive new and delete operations on a a few classes, I created a template base class that provides object pooling for any class that publically inherits it. It just overrides the new and delete operators. Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. :) Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
If you are having problems with new/delete, it is always a good idea to test with a good malloc/free first (which of course means a new new/delete). Doug Lea's allocator is excellent. http://gee.cs.oswego.edu/dl/[^] Tim Smith I'm going to patent thought. I have yet to see any prior art.
-
To improve performance due to excessive new and delete operations on a a few classes, I created a template base class that provides object pooling for any class that publically inherits it. It just overrides the new and delete operators. Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. :) Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Thomas George wrote: Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. If it's sweet and simple its cool :) I did something similar in C to "buffer" many mallocs, would be nice to see in C++. I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
-
If you are having problems with new/delete, it is always a good idea to test with a good malloc/free first (which of course means a new new/delete). Doug Lea's allocator is excellent. http://gee.cs.oswego.edu/dl/[^] Tim Smith I'm going to patent thought. I have yet to see any prior art.
Thank you very much. But, I don't know whether I need a completely new allocator. My objects had only the default constructors. So, overriding the new and delete operators serves the purpose for me. The performance of my application increased 20%. But, I don't know whether this can ever be a general purpose solution. Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
-
Thank you very much. But, I don't know whether I need a completely new allocator. My objects had only the default constructors. So, overriding the new and delete operators serves the purpose for me. The performance of my application increased 20%. But, I don't know whether this can ever be a general purpose solution. Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
The only reason I pointed this out is because often times these lookaside lists and such turn out to be slower than Lea's generic solution. Thus I always suggest that people try Lea's allocator before writing their own specialized allocator. Tim Smith I'm going to patent thought. I have yet to see any prior art.
-
The only reason I pointed this out is because often times these lookaside lists and such turn out to be slower than Lea's generic solution. Thus I always suggest that people try Lea's allocator before writing their own specialized allocator. Tim Smith I'm going to patent thought. I have yet to see any prior art.
OK. I will try that out. :-) My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
-
To improve performance due to excessive new and delete operations on a a few classes, I created a template base class that provides object pooling for any class that publically inherits it. It just overrides the new and delete operators. Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. :) Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Sounds cool. Just reading through Efficient C++ Performance Programming Techniques, covers SIngle-Threaded and Multi-Threaded memory pooling. Reduced the time taken to allocate and delete memory from 1500msecs to 43 :) Putting it all in a template would be really interesting! I vote for it. -- Paul "Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office." - David Brent, from "The Office" MS Messenger: paul@oobaloo.co.uk
-
Sounds cool. Just reading through Efficient C++ Performance Programming Techniques, covers SIngle-Threaded and Multi-Threaded memory pooling. Reduced the time taken to allocate and delete memory from 1500msecs to 43 :) Putting it all in a template would be really interesting! I vote for it. -- Paul "Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office." - David Brent, from "The Office" MS Messenger: paul@oobaloo.co.uk
I have an option by which the user can decide whether to use the multithreading code or not. I will have the article up this weekend. The allocation speeds that I got for a new/delete pair Single Threaded: 0.06 micro seconds Multi Threaded: 0.41 micro seconds Without the class: 3.20 micro seconds Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
-
I have an option by which the user can decide whether to use the multithreading code or not. I will have the article up this weekend. The allocation speeds that I got for a new/delete pair Single Threaded: 0.06 micro seconds Multi Threaded: 0.41 micro seconds Without the class: 3.20 micro seconds Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Cool, look forward to reading it. -- Paul "Put the key of despair into the lock of apathy. Turn the knob of mediocrity slowly and open the gates of despondency - welcome to a day in the average office." - David Brent, from "The Office" MS Messenger: paul@oobaloo.co.uk
-
To improve performance due to excessive new and delete operations on a a few classes, I created a template base class that provides object pooling for any class that publically inherits it. It just overrides the new and delete operators. Is this class worthy of an article? I mean if someone needed it, it could be written in less than half an hour. :) Thomas My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Sounds good but what I was looking at in writing my own cache manager was an abstract factory that would create the objects requested and then if the objects had an attribute [Cacheable] defined for the class then the abstract factory would/could cache the object. This way I didn't have to have any inheritance or implement different interfaces to get my classes managed by the cache manager. But I would be interested in seeing what you've done. [EDIT]Never mind, I just realized that you were'nt talking about C#. I've been doing so much C# coding recently that I assume everyone is doing it. I need to get my C++ fix[/EDIT]
-
OK. I will try that out. :-) My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
Thomas George wrote: OK. I will try that out. If you do I'd be interested in knowing the results. You might also want to look at: http://www.garret.ru/~knizhnik/threadalloc/readme.html[^] Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program
-
Thomas George wrote: OK. I will try that out. If you do I'd be interested in knowing the results. You might also want to look at: http://www.garret.ru/~knizhnik/threadalloc/readme.html[^] Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program
I am planning to check that out tomorrow. I already downloaded the thing. In the mean time, I also made the pooling work, and have alreday posted an article. Check that out also. My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
-
I am planning to check that out tomorrow. I already downloaded the thing. In the mean time, I also made the pooling work, and have alreday posted an article. Check that out also. My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
The article looks good. Sure was quick. Not sure if I like using derivation though. I've had problems with overiding new when a class is multiply derived and you get the dreaded diamond and the root is CObject. Not that, that is an issue here. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program