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

Optimize TexData (mostly QoiConverter) #886

Merged
merged 7 commits into from
May 7, 2022
Merged

Optimize TexData (mostly QoiConverter) #886

merged 7 commits into from
May 7, 2022

Conversation

cgytrus
Copy link
Contributor

@cgytrus cgytrus commented May 4, 2022

Optimizes QoiConverter, makes TexData store a bitmap instead of PNG byte array and replaces most TextureBlob usages with a direct reference to the bitmap
The memory usage deserializing QOI images is drastically lower:
image

There isn't much that can be optimized in the serialization but it's still a bit better:

old screenshot

image

Memory usage here is also way lower in serialization now (about 40MB, instead of 380MB on a random 4K wallpaper image)

UndertaleModLib/Models/UndertaleEmbeddedTexture.cs Outdated Show resolved Hide resolved
UndertaleModLib/Models/UndertaleEmbeddedTexture.cs Outdated Show resolved Hide resolved
UndertaleModLib/Models/UndertaleEmbeddedTexture.cs Outdated Show resolved Hide resolved
UndertaleModLib/Util/QoiConverter.cs Outdated Show resolved Hide resolved
UndertaleModLib/Util/QoiConverter.cs Outdated Show resolved Hide resolved
UndertaleModLib/Util/TextureWorker.cs Outdated Show resolved Hide resolved
@Miepee
Copy link
Contributor

Miepee commented May 5, 2022

@cgytrus There are some weird issues where you have changes that revert some stuff back to before #884 .
Can you please solve those?

@VladiStep
Copy link
Member

@cgytrus There are some weird issues where you have changes that revert some stuff back to before #884 . Can you please solve those?

What the stuff exactly?

@Miepee
Copy link
Contributor

Miepee commented May 5, 2022

Did you look at the changed files?
It's now on closer inspection actually reverting more PRs than just yours.
Heres stuff that should be familiar to you as examples: https://github.com/krzys-h/UndertaleModTool/pull/886/files#diff-52aef5e24ad7bec01d20cf89ef64b39631999ff62ee694358ec074d33b1b6f48
https://github.com/krzys-h/UndertaleModTool/pull/886/files#diff-31b00c469c71d838c650abb658ddac97b1550db085aa4a6676ba0aee4b5ebe61

@VladiStep
Copy link
Member

Did you look at the changed files? It's now on closer inspection actually reverting more PRs than just yours. Heres stuff that should be familiar to you as examples: https://github.com/krzys-h/UndertaleModTool/pull/886/files#diff-52aef5e24ad7bec01d20cf89ef64b39631999ff62ee694358ec074d33b1b6f48 https://github.com/krzys-h/UndertaleModTool/pull/886/files#diff-31b00c469c71d838c650abb658ddac97b1550db085aa4a6676ba0aee4b5ebe61

Oh.
I just didn't notice the "Merge branch 'master' into master" commit.

Copy link
Contributor

@Miepee Miepee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly doc comments

UndertaleModLib/Util/QoiConverter.cs Show resolved Hide resolved
UndertaleModLib/Util/QoiConverter.cs Outdated Show resolved Hide resolved
UndertaleModLib/Util/QoiConverter.cs Outdated Show resolved Hide resolved
UndertaleModLib/Util/QoiConverter.cs Outdated Show resolved Hide resolved
UndertaleModLib/Util/QoiConverter.cs Outdated Show resolved Hide resolved
@Grossley Grossley merged commit b54a4a7 into UnderminersTeam:master May 7, 2022
@cgytrus cgytrus mentioned this pull request May 7, 2022
Miepee added a commit to Miepee/UndertaleModTool that referenced this pull request May 8, 2022
@Miepee Miepee mentioned this pull request May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants