Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Massive performance regression in v2 non-native generator #124

Open
PokeMMO opened this issue Jun 2, 2019 · 3 comments
Open

Massive performance regression in v2 non-native generator #124

PokeMMO opened this issue Jun 2, 2019 · 3 comments

Comments

@PokeMMO
Copy link

PokeMMO commented Jun 2, 2019

Even if you supply MmapByteSource's to FileByFileDeltaGenerator, it seems to replace them with RandomAccessFileByteSource's.

https://github.com/google/archive-patcher/blob/v2/generator/src/main/java/com/google/archivepatcher/generator/FileByFileDeltaGenerator.java#L108-L109

https://github.com/google/archive-patcher/blob/v2/shared/src/main/java/com/google/archivepatcher/shared/bytesource/ByteSource.java#L61-L63

The current RandomAccessFileByteSource's implementation seems to suffer extremely hard from seeks, an extremely common operation.

Simply swapping ByteSource.fromFile to always return a MmapByteSource greatly improves performance.

@pspencil
Copy link

pspencil commented Jun 2, 2019 via email

@PokeMMO
Copy link
Author

PokeMMO commented Jun 2, 2019

I would expect FileByFileDeltaGenerator to keep the same ByteSource implementation that is supplied to it.

Or just use mmap for everything (This is what the JNI lib does)

@Archive-Patcher-Sync-Robot
Copy link
Contributor

I have switched to mmap. It is better but still slower than master. I will need more investigation on how to optimise this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants