Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.

Performance

Maximilian Dorn edited this page Dec 27, 2020 · 3 revisions

Performance

packet-maps is pretty light on the server performance. There's one exception though: Matching RGB values with map colors.

When you match your RGB value the library will loop through every single map color (~250) and find the one that's closest to the color you provided. This is a heavy operation and it is advised to cache the results. Matching a few colors on the go is fine but matching a whole 256 * 256 image every tick will lag the server out a lot.

packet-maps has built in caching functionality. You can utilise the FramedCache class (see FramedCache#buildCache()) for caching moving images for example. I will probably rewrite the caching stuff because I'm not 100% happy with it though.

TL;DR

Cache your RGB -> map color conversions or else your server is going to have a really bad time.

Clone this wiki locally