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

  • SEARCH
  • Home
  • 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 634471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:17:58+00:00 2026-05-13T20:17:58+00:00

I have noticed a huge performance hit in one of my projects when logging

  • 0

I have noticed a huge performance hit in one of my projects when logging is enabled for the first time. But when the log file limit is reached and the program starts writing to the beginning of the file again, the logging speed is much faster (about 50% faster). It’s normal to set the log file size to hundreds of MBs.

Most download managers allocate dummy file with the required size before starting to download the file. This makes the writing more effecient because the whole chunk is allocated at once.

What is the best way to reserve disk space efficiently, by some fixed size, when my program starts for the first time?

  • 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-13T20:17:59+00:00Added an answer on May 13, 2026 at 8:17 pm
    void ReserveSpace(LONG spaceLow, LONG spaceHigh, HANDLE hFile)
    {
        DWORD err = ::SetFilePointer(hFile, spaceLow, &spaceHigh, FILE_BEGIN);
    
        if (err == INVALID_SET_FILE_POINTER) {
            err = GetLastError();
            // handle error
        }
        if (!::SetEndOfFile(hFile)) {
            err = GetLastError();
            // handle error
        }
        err = ::SetFilePointer(hFile, 0, 0, FILE_BEGIN); // reset
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have noticed that regardless of a given script's execution time, every date() call
I have noticed some developers picking up new skills and moving from one platform
We have a message processing system with high performance demands. Recently we have noticed
While making a webpage I've noticed a huge decrease in performance(client side) when I've
I have a nice and lovely Django site up and running, but have noticed
I have noticed that many big(huge) sites like Google and Facebook when looking to
Let's say I have huge tree view and one the branches is in variable
I have a file in which I have dumped a huge number of lists.Now
I have noticed that cURL in PHP returns different data when told to output
I have noticed that some apps like Safari and Mail show a loading indicator

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.