aadnk / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
287 stars 92 forks source link

Fix performance issue #115

Closed Emiel45 closed 7 years ago

Emiel45 commented 7 years ago

Looking up classes often causes performance issues. If ProtocolLib is used with old versions of Minecraft (1.8) it will try to lookup classes like the ChunkPosition class, as a result this class gets looked up over and over again. Looking up classes causes locking and can become a very slow and intensive operation. To combat this I have made a small change to the CachedPackage class so it remembers if classes weren't found previously. This has been tested and appears to fix the performance issue I was having.

dmulloy2 commented 7 years ago

Interesting. I'd imagine this would help across all versions, not just 1.8.

Could you submit this in the downstream repo (https://github.com/dmulloy2/ProtocolLib)? It's easier to pull there and push the changes upstream.

Emiel45 commented 7 years ago

Sure, shall I just resubmit the pull request there and close this one?

Emiel45 commented 7 years ago

I don't seem to be able to make a pull request on your fork, it automatically identifies this one as already existing. Maybe I'm doing something wrong?

Emiel45 commented 7 years ago

You should be able to clone my fork and edit it.

dmulloy2 commented 7 years ago

That's ...odd... but that's git for ya.