Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Promit

One read vs. multiple sequential reads

This topic is 5443 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve seen two major patterns in loading files (files like BSP, MD2, etc.) One is to load each block of data sequentially. The other is to load the entire file at once and then use memory offsets to pull data from the file buffer. If you assume no fseeks in either method, which is generally going to perform better?

Share this post


Link to post
Share on other sites
Advertisement
Probably about the same, though I''m sure it''d depend on a number of factors. If they''re using a buffered file stream like fopen, it probably won''t be much different, unless the data blocks are big. In general, loading more data (up to a certain point) in one go is better, but it''s not all that deterministic without timings.

I like pie.

Share this post


Link to post
Share on other sites
Depends on how the information is used, the block size in the first method, if the second method uses memory mapping, phase of the moon during compile, how buffering is performed, the underlying operating system, what kind of device the file is being pulled from, whether Mercury is in the third house at runtime, the total physical memory and page file size of the computer running the application, etc.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!