Dealing with very large binary files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sebastian.harko@gmail.com

    #1

    Dealing with very large binary files

    Helllo,

    What's the general accepted strategy for dealing with very large
    binary files in C# ?
    I have to do a program that reads some "multi frame bitmap " files
    which can reach up to one hundred megs so I need to know how to
    optimize reading a file..

    Best regards,
    Seb

  • Peter Duniho

    #2
    Re: Dealing with very large binary files

    sebastian.harko @gmail.com wrote:
    What's the general accepted strategy for dealing with very large
    binary files in C# ?
    Very large binary files? Read a little bit at a time.
    I have to do a program that reads some "multi frame bitmap " files
    which can reach up to one hundred megs so I need to know how to
    optimize reading a file..
    Oh. I thought you were asking about "very large binary files". These
    days, 100MB isn't really all that big. :)

    That said, you are likely to find that the most important issue is to
    make sure you read enough data at one time. You can use a
    BufferedStream to ensure this, but my experience has been that even
    FileStream has some built-in buffering (caching at the OS level) that
    results in pretty good performance anyway.

    Do you have a specific issue that is coming up in which performance is
    not satisfactory? Generally, it's better to not waste time optimizing
    until you know what performance problem you're trying to solve. Until
    you have an actual performance problem, you can't answer that.

    Pete

    Comment

    • Jonathan Wood

      #3
      Re: Dealing with very large binary files

      It really depends on what you will do with those files. But you might check
      out memory-mapped files.

      --
      Jonathan Wood
      SoftCircuits Programming


      <sebastian.hark o@gmail.comwrot e in message
      news:1186426586 .216415.96080@5 7g2000hsv.googl egroups.com...
      Helllo,
      >
      What's the general accepted strategy for dealing with very large
      binary files in C# ?
      I have to do a program that reads some "multi frame bitmap " files
      which can reach up to one hundred megs so I need to know how to
      optimize reading a file..
      >
      Best regards,
      Seb
      >

      Comment

      • Ignacio Machin \( .NET/ C# MVP \)

        #4
        Re: Dealing with very large binary files

        HI,

        <sebastian.hark o@gmail.comwrot e in message
        news:1186426586 .216415.96080@5 7g2000hsv.googl egroups.com...
        Helllo,
        >
        What's the general accepted strategy for dealing with very large
        binary files in C# ?
        Depend of your escenario and of the kind of processing you need to do.
        I have to do a program that reads some "multi frame bitmap " files
        which can reach up to one hundred megs so I need to know how to
        optimize reading a file..
        And do what with them? As I said depending of your intended action will be
        the best way of handling it


        Comment

        Working...