Skip to content

Use file allocation size where it's beneficial #51116

@adamsitnik

Description

@adamsitnik
  1. Identify places, where we know the file size up-front. Example: File.WriteAll*. File.Copy etc.
  2. Ensure that the given source code has benchmarks coverage in the performance repo (contribute new benchmarks).
  3. Change the source code to use the new FileStream ctor that allows for specifying allocationSize and specify the exact value (or estimation as OS is smart enough to shrink the file (when it's closed) if it was too much).
  4. Compare before vs after. If there is a visible performance or reliability gain, contribute the change to dotnet/runtime.

Since #51111 has not been merged yet, please use it for measurements.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions