-
-
Notifications
You must be signed in to change notification settings - Fork 0
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.
Cache your RGB -> map color conversions or else your server is going to have a really bad time.