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 7016311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:46:05+00:00 2026-05-27T22:46:05+00:00

Yesterday,I asked the question at here: how do disable disk cache in c# invoke

  • 0

Yesterday,I asked the question at here:how do disable disk cache in c# invoke win32 CreateFile api with FILE_FLAG_NO_BUFFERING.

In my performance test show(write and read test,1000 files and total size 220M),the FILE_FLAG_NO_BUFFERING can’t help me improve performance and lower than .net default disk cache,since i try change FILE_FLAG_NO_BUFFERING to FILE_FLAG_SEQUENTIAL_SCAN can to reach the .net default disk cache and faster little.

before,i try use mongodb’s gridfs feature replace the windows file system,not good(and i don’t need to use distributed feature,just taste).

in my Product,the server can get a lot of the smaller files(60-100k) on per seconds through tcp/ip,then need save it to the disk,and third service read these files once(just read once and process).if i use asynchronous I/O whether can help me,whether can get best speed and best low cpu cycle?. someone can give me suggestion?or i can still use FileStream class?

update 1

the memory mapped file whether can to achieve my demand.that all files write to one big file or more and read from it?

  • 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-27T22:46:05+00:00Added an answer on May 27, 2026 at 10:46 pm

    If your PC is taking 5-10 seconds to write a 100kB file to disk, then you either have the world’s oldest, slowest PC, or your code is doing something very inefficient.

    Turning off disk caching will probably make things worse rather than better. With a disk cache in place, your writes will be fast, and Windows will do the slow part of flushing the data to disk later. Indeed, increasing I/O buffering usually results in significantly improved I/O in general.

    You definitely want to use asynchronous writes – that means your server starts the data writing, and then goes back to responding to its clients while the OS deals with writing the data to disk in the background.

    There shouldn’t be any need to queue the writes (as the OS will already be doing that if disc caching is enabled), but that is something you could try if all else fails – it could potentially help by writing only one file at a time to minimise the need for disk seeks..

    Generally for I/O, using larger buffers helps to increase your throughput. For example instead of writing each individual byte to the file in a loop, write a buffer-ful of data (ideally the entire file, for the sizes you mentioned) in one Write operation. This will minimise the overhead (instead of calling a write function for every byte, you call a function once for the entire file). I suspect you may be doing something like this, as it’s the only way I know to reduce performance to the levels you’ve suggested you are getting.

    Memory-mapped files will not help you. They’re really best for accessing the contents of huge files.

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

Sidebar

Related Questions

Yesterday I asked this general question about decimals and their internal precisions. Here is
While looking at a micro-optimization question that I asked yesterday ( here ), I
I asked a question yesterday on here and got some awsome help, but I
Yesterday I asked a question here about a oneliner and mjschultz gave me an
Yesterday I asked a question here that got more momentum that what I thought
Its similar question that I asked yesterday here with a slight modification. Here are
I asked a question here yesterday ( cfquery grouping, counts & maxrows ) to
Following the question I had asked yesterday which is here passing contents from multiple
Yesterday I asked the question on how I should save my files. After some
Yesterday I asked a question on how to re-write SQL to do selects and

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.