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. Article Links?

Article Links?

Scheduled Pinned Locked Moved The Lounge
debuggingquestion
6 Posts 5 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.
  • K Offline
    K Offline
    Kyudos
    wrote on last edited by
    #1

    My Google-fu is not working - I keep ending up with maths links! Does anyone have any links to articles / resources detailing the time overhead of logging to file? I've added logging to my undo functions to give a rough session activity trace and my boss is concerned about the time overhead wrt file access (I open, append, and flush every message). Before I start timing things, can anyone speak about this from experience?

    R B N P 4 Replies Last reply
    0
    • K Kyudos

      My Google-fu is not working - I keep ending up with maths links! Does anyone have any links to articles / resources detailing the time overhead of logging to file? I've added logging to my undo functions to give a rough session activity trace and my boss is concerned about the time overhead wrt file access (I open, append, and flush every message). Before I start timing things, can anyone speak about this from experience?

      R Offline
      R Offline
      Ron Beyer
      wrote on last edited by
      #2

      Actually the best way to do this is to whip up a quick test program. Should be very simple, I would benchmark 10,000 writes and see what the min/max/average time is. Also do this during disk operations (move a big file) to get a good measure.

      1 Reply Last reply
      0
      • K Kyudos

        My Google-fu is not working - I keep ending up with maths links! Does anyone have any links to articles / resources detailing the time overhead of logging to file? I've added logging to my undo functions to give a rough session activity trace and my boss is concerned about the time overhead wrt file access (I open, append, and flush every message). Before I start timing things, can anyone speak about this from experience?

        B Offline
        B Offline
        BillWoodruff
        wrote on last edited by
        #3

        A little CodeProject-fu can go a long way: [^]. That's only one of a number of excellent articles on CP relevant to precision Timeing in .NET. You should use the StopWatch Class, not a Timer. good luck, Bill

        "What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts. Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett

        1 Reply Last reply
        0
        • K Kyudos

          My Google-fu is not working - I keep ending up with maths links! Does anyone have any links to articles / resources detailing the time overhead of logging to file? I've added logging to my undo functions to give a rough session activity trace and my boss is concerned about the time overhead wrt file access (I open, append, and flush every message). Before I start timing things, can anyone speak about this from experience?

          N Offline
          N Offline
          Nicholas Marty
          wrote on last edited by
          #4

          If you're really concerned about the impact of logging to a file you can do the logging in a seperate thread dedicated to that functionality. This may be a bit more resource intensive than directly writing to the file but also reduces the cost on the main execution thread.

          1 Reply Last reply
          0
          • K Kyudos

            My Google-fu is not working - I keep ending up with maths links! Does anyone have any links to articles / resources detailing the time overhead of logging to file? I've added logging to my undo functions to give a rough session activity trace and my boss is concerned about the time overhead wrt file access (I open, append, and flush every message). Before I start timing things, can anyone speak about this from experience?

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            This is one of the reasons I would look for external sources for logging, rather than rolling my own version. There are any number of excellent logging systems, and I would have looked to use one of these instead. Saying that, there are several things that you can do to alleviate issues - log in the background, don't write to file on every log (build a buffer which you periodically flush to disk), investigate alternatives to writing to file.

            K 1 Reply Last reply
            0
            • P Pete OHanlon

              This is one of the reasons I would look for external sources for logging, rather than rolling my own version. There are any number of excellent logging systems, and I would have looked to use one of these instead. Saying that, there are several things that you can do to alleviate issues - log in the background, don't write to file on every log (build a buffer which you periodically flush to disk), investigate alternatives to writing to file.

              K Offline
              K Offline
              Kyudos
              wrote on last edited by
              #6

              This is essentially a debugging tool, since our users are rubbish at describing what they were doing when a problem / crash happened (aren't they all?). I started off logging to memory, then dumping the session log and call stack in my "crash-catcher". But then I was concerned about memory usage and likelihood-of-failure at the crucial moment, and obviously then my log wouldn't be available in non-crash situations. Since it is a CAD program and logging actions happen only a little more frequently than you can do things with a mouse, I don't think the overhead will be significant - but I'll probably have to do some timings to prove it to my boss! I'll also chuck in a settings switch to turn logging off if necessary, that should keep everyone happy :)

              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