Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Is this worthy of an article?

Is this worthy of an article?

Scheduled Pinned Locked Moved The Lounge
csscomperformancequestioncode-review
16 Posts 9 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    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

    J Offline
    J Offline
    John Fisher
    wrote on last edited by
    #2

    Write it up and find out! I'm sure you'll get some good votes. "Yeah, and I invented the spellchecker" - fellow inventor Dan Quayle on hearing that Al Gore invented the Internet.

    1 Reply Last reply
    0
    • L Lost User

      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

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #3

      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

      1 Reply Last reply
      0
      • L Lost User

        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

        N Offline
        N Offline
        Nick Parker
        wrote on last edited by
        #4

        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

        1 Reply Last reply
        0
        • L Lost User

          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

          T Offline
          T Offline
          Tim Smith
          wrote on last edited by
          #5

          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.

          L 1 Reply Last reply
          0
          • L Lost User

            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

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #6

            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

            1 Reply Last reply
            0
            • T Tim Smith

              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.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              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

              T 1 Reply Last reply
              0
              • L Lost User

                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

                T Offline
                T Offline
                Tim Smith
                wrote on last edited by
                #8

                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.

                L 1 Reply Last reply
                0
                • T Tim Smith

                  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.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #9

                  OK. I will try that out. :-) My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers

                  N 1 Reply Last reply
                  0
                  • L Lost User

                    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

                    P Offline
                    P Offline
                    Paul Ingles
                    wrote on last edited by
                    #10

                    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

                    L 1 Reply Last reply
                    0
                    • P Paul Ingles

                      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

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      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

                      P 1 Reply Last reply
                      0
                      • L Lost User

                        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

                        P Offline
                        P Offline
                        Paul Ingles
                        wrote on last edited by
                        #12

                        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

                        1 Reply Last reply
                        0
                        • L Lost User

                          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

                          T Offline
                          T Offline
                          Terry Denham
                          wrote on last edited by
                          #13

                          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]

                          1 Reply Last reply
                          0
                          • L Lost User

                            OK. I will try that out. :-) My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers

                            N Offline
                            N Offline
                            Neville Franks
                            wrote on last edited by
                            #14

                            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

                            L 1 Reply Last reply
                            0
                            • N Neville Franks

                              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

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #15

                              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

                              N 1 Reply Last reply
                              0
                              • L Lost User

                                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

                                N Offline
                                N Offline
                                Neville Franks
                                wrote on last edited by
                                #16

                                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

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups