Open barnabwhy opened 2 days ago
getDistance
org.bukkit.map.MapPallete
obc.map.CraftMapCanvas
drawImage
System.arraycopy
Saw a ~30% performance improvement in obc.map.CraftMapView.render()
obc.map.CraftMapView.render()
Tested with a world containing many custom maps created using the ImageOnMap plugin, modified to remove this optimisation so that it renders every tick. Before: https://spark.lucko.me/NVdWKmSlFr After: https://spark.lucko.me/j6AJiFG9pD
ImageOnMap
getDistance
inorg.bukkit.map.MapPallete
obc.map.CraftMapCanvas
to reduce comparisonsdrawImage
if it is larger than the available size.System.arraycopy
to avoid iterating over the colors in the image.Saw a ~30% performance improvement in
obc.map.CraftMapView.render()
Tested with a world containing many custom maps created using the
ImageOnMap
plugin, modified to remove this optimisation so that it renders every tick. Before: https://spark.lucko.me/NVdWKmSlFr After: https://spark.lucko.me/j6AJiFG9pD