Ender IO Zoo

Ender IO Zoo

962k Downloads

Possible performance optimization: Reduce usage of Multimaps

gabizou opened this issue ยท 1 comments

commented

Issue Description:

After profiling a production server, I've been attempting to isolate areas where we can potentially optimize things throughout the server, and in this case, a mod. As people use EnderIO for a lot of things, this is somewhat of a non-micro optimization.

With the provided profiling results:
yourkit

The TileTransceiver.getRecieveChannels is adding an unnecessary cost to the processing of power. Namely due to using Guava's multi map. The lookup isn't so much of the issue, it's the creation of collections that is costing unnecessary time per tick. Normally this wouldn't be covered as an issue, but due to the opportunity to eliminate extra time spent on the set, I'd suggest the possibility of using an EnumMap<ChannelType, Set<Channel>> to avoid constantly creating new wrapped sets. Ideally this would simplify a lot of the methods to retrieving a set and of course, modifying said set.


Affected Versions (Do not use "latest"):

  • EnderIO: v1.10.2-3.1.156
  • EnderCore: v1.10.2-0.4.1.65-beta
  • Minecraft: 1.10.2
  • Forge: 12.18.3.2281

Your most recent log file where the issue was present:

Not applicable, however, I can provide a profiling snapshot.

commented

There's still a Guava thingy left? Darn, must have overlooked that one. Thx.