WIP: Improve transferImageData performance#42
Draft
Leridon wants to merge 3 commits intoskillbert:masterfrom
Draft
WIP: Improve transferImageData performance#42Leridon wants to merge 3 commits intoskillbert:masterfrom
Leridon wants to merge 3 commits intoskillbert:masterfrom
Conversation
- Transfers are batched horizontally to make combining them faster. - Use fast library for base64 decoding - Simplify conversion from bgra to rgba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Had a look into the library to improve performance of data transfer for puzzle and chatbox readers in Clue Trainer, and came across this section, which has some potential in my opinion.
byte-base64)Buffer.from(str, "base64")alternative is slowe by a huge factor.Profiling on my device results in speedups of around 30%, both for smaller areas (slider puzzles) and full screen captures.
This only covers the path via
ImgRefBind.read. I haven't touched other usages ofdecodeImageStringyet, but they are probably worth looking at as well.There's also the question of
maxtransfer. Why is the value inwrapper.ts(40000) different from the one that is provided at runtime atalt1.maxtransfer(100000)? Which one is right? Could performance be improved by using the larger one?