-
Notifications
You must be signed in to change notification settings - Fork 159
Fix memory overhead #296
Fix memory overhead #296
Conversation
|
I'll provide numbers soon and give a shout when it's ready to merge. |
|
Ok, so, running the whole thing in VS diagnostics: 100 times iteration on a 65 * 1000 * 1000 bytes, gc.collect after each run - worst case possible.
Without GCs:
I'd definitely say this is an improvement. It also seems that the byte arrays get reused (rare collections), so this is a big +. These numbers are just for crunching and not meant to say anything more than this solution is an improvement. Overall speed and memory usage should be improved by this PR. Marking as ready to merge. cc @kjpou1 |
|
Tests done with this code. File created in cmd/powershell in the working directory of the application with |
abdee19 to
bc6f3b0
Compare
|
Also tested them for integrity. |
|
Up for theoretical case from #295: The asset stream is X bytes. With the old version, there would be at least ... bytes allocated:
With the init version:
With the new version:
|
|
Just a further note. It may be useful to abstract this into an internal extension method on |
|
Thanks Marius |






No description provided.