-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move back to nx archivemanager #659
Conversation
@Sewer56 mind taking a look at |
Codecov Report
@@ Coverage Diff @@
## main #659 +/- ##
==========================================
+ Coverage 64.29% 64.55% +0.26%
==========================================
Files 633 633
Lines 18054 18145 +91
Branches 1172 1176 +4
==========================================
+ Hits 11607 11714 +107
+ Misses 6150 6131 -19
- Partials 297 300 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Sure, I got some time to spare. I'll have a look very soon. The advanced installer suggestion stuff I'm finishing up is dependent on AL's current work (their work changes API I have to interface with); so it'd be more efficient for me to fully wait until that's finalised anyway, as I've been working off of an incomplete PR. |
Is this ready for review? |
No, there's something weird going on with this and I need to investigate. |
This PR conflicts with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the changes above then it's good for merging.
I'll detail the performance gimmick I mentioned earlier in a new issue. We can adjust the text of that issue as needed.
|
||
private void MakeBlocks(int chunkSize) | ||
{ | ||
// Slow due to copy to stack, but not that big a deal here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated code for this shouldn't incur a stack copy; it would use the heap allocated value stored inside of ChunkedArchiveStream
directly (basically by pointer).
If FileEntry
was a readonly field and JIT couldn't determine if called method is pure, a stack copy could occur, but that is not the case.
settings.MaxNumThreads = 1; | ||
var settings = new UnpackerSettings | ||
{ | ||
MaxNumThreads = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a leftover from developing/testing?
The other overload that's actually used by the LayoutSynchronizer runs on all threads.
|
||
unpacker.ExtractFiles(infos.Select(o => (IOutputDataProvider)o.Item2).ToArray(), settings); | ||
foreach (var info in infos) | ||
foreach (var (hash, output, size) in infos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that IOutputDataProvider
should be disposed by the user (via IDisposable
).
In this case, it is not necessary because the output type is OutputArrayProvider
, and there's nothing to dispose for that type, but this should probably be noted as a comment just in case.
DecompressSize = _entry.DecompressedBlockOffset + (int)Math.Min(remainingDecompSize, (ulong)chunkSize) | ||
}; | ||
|
||
_blocks.Add(block); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be preallocated as array rather than using list; since the number of blocks (chunkCount) is known ahead of time. Could make this method return array that directly assigns to _blocks
field.
# Conflicts: # Directory.Packages.props
This PR doesn't conflict with |
Currenty this still fails due to a ZStd decompression error in the SDV tests. The unit tests for the archive manager work fine. But something with how SDV is doing things is causing this to fail.