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. File Loading Question

File Loading Question

Scheduled Pinned Locked Moved C / C++ / MFC
questionhardwareperformancehelpdiscussion
3 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.
  • S Offline
    S Offline
    SanShou
    wrote on last edited by
    #1

    This seems like a simple question but I just wanted to know peoples thougths on it. Is it better to load an entire Megabyte file all at once and parse it through memory, or is it better to parse through it a line at a time consuming minimal memory? I implemented the second method for large file downloads to an embedded system but I would love to hear what others thoughts are on this issue. Thanks, Brian

    P V 2 Replies Last reply
    0
    • S SanShou

      This seems like a simple question but I just wanted to know peoples thougths on it. Is it better to load an entire Megabyte file all at once and parse it through memory, or is it better to parse through it a line at a time consuming minimal memory? I implemented the second method for large file downloads to an embedded system but I would love to hear what others thoughts are on this issue. Thanks, Brian

      P Offline
      P Offline
      Pavel Klocek
      wrote on last edited by
      #2

      You can use memory mapped file. Pavel Sonork 100.15206

      1 Reply Last reply
      0
      • S SanShou

        This seems like a simple question but I just wanted to know peoples thougths on it. Is it better to load an entire Megabyte file all at once and parse it through memory, or is it better to parse through it a line at a time consuming minimal memory? I implemented the second method for large file downloads to an embedded system but I would love to hear what others thoughts are on this issue. Thanks, Brian

        V Offline
        V Offline
        valikac
        wrote on last edited by
        #3

        You should use file mapping for big files. Otherwise, reading a file one line at a time will have the same result as reading the entire file such as in binary mode using C++. Kuphryn

        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