How to parse a text file in C# and be io bound?

后端 未结 7 689
名媛妹妹
名媛妹妹 2020-12-03 19:01

It is known that if you read data from disc you are IO bound and you can process/parse the read data much faster than you can read it from disc.

But this common wis

7条回答
  •  猫巷女王i
    2020-12-03 19:11

    IF you work with big files the fastest you can get is AFAIK the MemoryMappedFile class (new in .NET 4).

    By this you basically use the OS FileSystem cache-manager memory pages directly... if this is not fast enough then you would need to write your own filesystem...

    As for the GC the behaviour can be customized via app.config - for example:

    
       
    
    

    For the GC customization options see http://msdn.microsoft.com/en-us/library/6bs4szyc.aspx - esp. / .

提交回复
热议问题