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. General Programming
  3. C / C++ / MFC
  4. Slow delete under MFC?

Slow delete under MFC?

Scheduled Pinned Locked Moved C / C++ / MFC
c++dockerperformancequestion
4 Posts 3 Posters 0 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 Offline
    L Offline
    LozEvans
    wrote on last edited by
    #1

    Ladies and Gents, Wrote a Win 32 app, which ran nicely thankyou, within it I had aggregate structures containing up to 800K instances of a Point class. All was well. When I ported it to run in under an MFC app, the delete of the top level container was taking > 5 seconds, where previously it was near instantaneous. It uses STL containers, all the usual speed up tricks, but simply moving the classes into an MFC app causes it to run very very slow.... when deleting. Anyone come across this?? Any idea's?? Cheers Laurence

    A N 2 Replies Last reply
    0
    • L LozEvans

      Ladies and Gents, Wrote a Win 32 app, which ran nicely thankyou, within it I had aggregate structures containing up to 800K instances of a Point class. All was well. When I ported it to run in under an MFC app, the delete of the top level container was taking > 5 seconds, where previously it was near instantaneous. It uses STL containers, all the usual speed up tricks, but simply moving the classes into an MFC app causes it to run very very slow.... when deleting. Anyone come across this?? Any idea's?? Cheers Laurence

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Are you compiling with debug enabled? MFC has a special new/delete for debug builds, that does a lot of memory leak checking. Great for debugging, but it slows it down a lot.

      L 1 Reply Last reply
      0
      • A Anonymous

        Are you compiling with debug enabled? MFC has a special new/delete for debug builds, that does a lot of memory leak checking. Great for debugging, but it slows it down a lot.

        L Offline
        L Offline
        LozEvans
        wrote on last edited by
        #3

        Thanks for the reply. Tried it under Debug and Release, with the same Nett result. Omitted the DEBUG_NEW macro from the classes in question anyway. Cheers Laurence

        1 Reply Last reply
        0
        • L LozEvans

          Ladies and Gents, Wrote a Win 32 app, which ran nicely thankyou, within it I had aggregate structures containing up to 800K instances of a Point class. All was well. When I ported it to run in under an MFC app, the delete of the top level container was taking > 5 seconds, where previously it was near instantaneous. It uses STL containers, all the usual speed up tricks, but simply moving the classes into an MFC app causes it to run very very slow.... when deleting. Anyone come across this?? Any idea's?? Cheers Laurence

          N Offline
          N Offline
          Nitron
          wrote on last edited by
          #4

          Are you using vector or deque? Interesting stuff happens when cleaning up a big mess... Check out my article on this topic: http://www.codeproject.com/vcpp/stl/vector_vs_deque.asp#_Experiment3[^] ~Nitron.


          ññòòïðïðB A
          start

          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