Git Product home page Git Product logo

Comments (13)

embeddedt avatar embeddedt commented on August 12, 2024

After doing some research apparently getCanonicalPath is very slow on Windows. I will have to write some mixins to strip it out of the resource pack handling code. Are there other resource loading mods commonly used besides BASE and Resource Loader?

from vintagefix.

jchung01 avatar jchung01 commented on August 12, 2024

Those are the only two I'm aware of, so it'll probably need further testing/profiling later.

from vintagefix.

MagmaBro123 avatar MagmaBro123 commented on August 12, 2024

Load My Resources exists, iirc

from vintagefix.

embeddedt avatar embeddedt commented on August 12, 2024

How is performance with the latest commit?

from vintagefix.

jchung01 avatar jchung01 commented on August 12, 2024

The performance is definitely better and the profiling seems to indicate that getCanonicalPath is no longer an issue. However, there are still consistent dips in performance when loading items, most noticeably from vanilla and ContentTweaker. Here's some new reports, this time with ResourceLoader back in. Still using same modpack Meatballcraft for the first 3 profiles:

  • Profile for vanilla items when they are (re)loaded
  • Profile while scrolling through all other items (noticeably slow at ContentTweaker items)
  • Profile while scrolling through only ContentTweaker (CT) items. This is with LibNine/FluidDrawers disabled to isolate the issue a bit more.
  • Another profile for vanilla items, this time in E2EU

It seems like BASE is no longer an issue, and ResourceLoader is better, but from it NormalResourceLoader.getInputStream still accounts for a sizable amount of time (Can especially see this in the third profile). In fact, I'm not sure how ResourceLoader takes up so much time when viewing CT items considering CT textures don't need ResourceLoader to load.

Other observations are a) AbstractResourcePack.locationToName() uses String.format(), which I think can be improved by using concatenation/StringBuilder instead? and b) throwing FileNotFoundException seems to take up some time.
LibNine/FluidDrawers, AE2, and Chisel adds model loaders, which makes the performance impact add up further.

One last thing I've noticed is that it seems like browsing through the creative tabs doesn't have this performance impact that HEI has? I'm not sure if it's because of the different way the items are displayed, but I thought that was odd.

from vintagefix.

embeddedt avatar embeddedt commented on August 12, 2024

In fact, I'm not sure how ResourceLoader takes up so much time when viewing CT items considering CT textures don't need ResourceLoader to load.

ResourceLoader's pack might take priority over BASE; they both basically do the same thing.

One last thing I've noticed is that it seems like browsing through the creative tabs doesn't have this performance impact that HEI has? I'm not sure if it's because of the different way the items are displayed, but I thought that was odd.

Creative tabs display far less models on screen at once which puts a lot less pressure on the model system.

from vintagefix.

embeddedt avatar embeddedt commented on August 12, 2024

I've made some improvements to locationToName. Keep in mind this is probably not going to ever be fully fixed because Windows file IO is just slow in general - launch times are universally faster on Linux from my testing. But I will see how much I can mitigate it.

from vintagefix.

jchung01 avatar jchung01 commented on August 12, 2024

That's understandable, I would say the game is pretty playable, considering it's now only really noticeable with CT and vanilla textures. I figured I would just follow up to report my findings. Anyways, thanks for all the great work on this mod and your other mods!

from vintagefix.

embeddedt avatar embeddedt commented on August 12, 2024

Can you try the latest build?

from vintagefix.

jchung01 avatar jchung01 commented on August 12, 2024

Looks like latest build fixes the performance issues! HEI is very smooth now, profile here.

One last thing that I completely missed earlier, something from commit ea6cca8 causes CustomMainMenu/ResourceLoader to not load images on the main menu correctly.
2023-06-08_12 01 49
latest.log from latest build

from vintagefix.

embeddedt avatar embeddedt commented on August 12, 2024

I am pretty sure this is a Meatballcraft issue. It seems to happen on Linux even without VintageFix. Custom Main Menu tries to load a texture by the name menu:meatball.png (because the texture is converted to a resource location internally, which forces it to lower case) but the actual texture on disk is menu:Meatball.png, so it is not found. I suspect this is normally not noticeable on Windows as the canonicalization (which is what I removed) will sometimes silently correct these issues.

To be clear it is not safe to assume the OS ignores the case of files and Meatballcraft should probably rename this to be lowercase.

from vintagefix.

jchung01 avatar jchung01 commented on August 12, 2024

Got it, that indeed seems to be the case as editing the png to be all lowercase has fixed it. Didn't know about the canonicalization part for Windows. Sorry for reporting it on your side!

from vintagefix.

embeddedt avatar embeddedt commented on August 12, 2024

Good to hear; will close as I think my hack of baking all the item models ahead of time has solved the original problem.

from vintagefix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.