Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: (C++ question) What's the fastest way to load from HDD to RAM?  (Read 1961 times)

0 Members and 1 Guest are viewing this topic.

tom64

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Is it good practice (maximum efficient) to load data from a HDD file using the standard file loading function and a for loop? Or is there a faster way to load (especially if you're going to be loading large chunks of data in sequence from the HDD)?
Newbie to C++ and SFML

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
AW: Re: (C++ question) What's the fastest way to load from HDD to RAM?
« Reply #1 on: March 29, 2013, 02:51:05 pm »
standard file loading function and a for loop?
What do you mean by that?
The way to go with C++ is a fstream.

But depending on what the data is used for you might want to jump through the file instead of loading every byte into memoy.

Questions like, what is the best way to do X, are mostly bad questions, since it always depends on what you're doing, how large the data is, what PC specs you're developing for etc. -> provide more info :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/