This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit b01a16f
committed
Avoid unnecessary clearing in CopyToAsync
With getting buffers from the ArrayPool, we want to clear the buffers before we put them back into the pool. But we only need to clear the max amount we used, and we're very likely to be using much larger buffers than we actually need. This change keeps track of how much space we used and only clears that much.1 parent 3fe9860 commit b01a16f
File tree
2 files changed
+24
-6
lines changed- src
- Common/src/System/IO
- System.IO.FileSystem/src/System/IO
2 files changed
+24
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
| 1767 | + | |
1767 | 1768 | | |
1768 | 1769 | | |
1769 | 1770 | | |
| |||
1859 | 1860 | | |
1860 | 1861 | | |
1861 | 1862 | | |
1862 | | - | |
1863 | | - | |
| 1863 | + | |
| 1864 | + | |
1864 | 1865 | | |
1865 | 1866 | | |
1866 | 1867 | | |
1867 | | - | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
1868 | 1871 | | |
1869 | | - | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
1870 | 1880 | | |
1871 | 1881 | | |
1872 | 1882 | | |
| |||
1896 | 1906 | | |
1897 | 1907 | | |
1898 | 1908 | | |
1899 | | - | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1900 | 1912 | | |
1901 | 1913 | | |
1902 | 1914 | | |
| |||
0 commit comments