Skip to content
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

PPather: MpqFileStream over SFileExtractFile #535

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

Xian55
Copy link
Owner

@Xian55 Xian55 commented Sep 1, 2023

Changes:

Key difference:

  • Instead of extracting the given file into storage(HDD or SSD), rather access it in memory.
  • Reduce stream load times and cpu usage.

Later on further improvements:

  • Find a way to use ArrayPool over raw arrays when using MpqFileStream.ReadAllBytes
  • Sadly, it only gives the performance benefit, when using MpqFileStream.ReadAllBytes.
  • There's a Buffer copy when instantiating MemoryStream
  • Chunked/Buffered stream reading results slower process times :(

Tested with x86 and x64 builds as well.

…er DllImport. Use MpqFileStream over SFileExtractFile API.
@Xian55 Xian55 added refactor This ticket concerns the possible simplification of code/data. enhancement This pull request implements a new feature. labels Sep 1, 2023
@Xian55 Xian55 merged commit f5bcb5b into dev Sep 1, 2023
1 check passed
@Xian55 Xian55 deleted the refactor/ppather-memory-stream-over-extract branch September 1, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This pull request implements a new feature. refactor This ticket concerns the possible simplification of code/data.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant