Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6839549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:43:55+00:00 2026-05-26T23:43:55+00:00

I guess my question derives partially from this question: std::ifstream buffer caching. I have

  • 0

I guess my question derives partially from this question: std::ifstream buffer caching. I have a boost serialization archive, and am currently reading out of it with the & operator as suggested on the help. My understanding is this translates to << and >> for input and ouput operations. Now judging from above question, those operators, together with fstream, don’t give optimal performance.

What I need to do is read some few 100k objects and work on them sequentially and then delete them. Right now I literally do

  1. Read one object 2. Process it 3. Delete it 4. Repeat.

I am wondering whether I should change this to

  1. Read all objects into a queue 2. Process the queue 3. Delete everything

or whether I should implement some buffer for the file and read the binary file into the buffer first?

Or maybe start a second thread and have the second thread read the file with some thread handover?

And partially repeating above question, but does someone have more experience trying to optimize the fstream’s buffer, or maybe even a working example?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:43:55+00:00Added an answer on May 26, 2026 at 11:43 pm

    Changing it doesn’t make sense. By default, it goes through a buffered reader anyway, and this reader anyway reads off the hard drive in 4k chunks. Reading them one by one allows for better memory recycling. The only thing that might make sense is to change the 4k to a different number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HashMap (although I guess this question applies to other collections) of
I have my own control which derives from StackPanel. This control contains two other
I guess this is a quite simple (read: very simple) question, but I have
Okay guess this question looks a lot like: What is the best way to
I guess this question will sound familiar, but I am yet another programmer baffled
This is very basic magento question i guess. I want to first get all
A little stuck here. I have a simple question I guess. Given the following
My guess is that this question will fall under the category of duh, but,
I guess this is a simple question. I need to do something like this:
I guess this question of mine is pretty basic but since Ive never done

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.