Performance of BlockState.hashCode may be improved

XMLWordPrintable

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None

      When I look at a profiler's output then the BlockState.hashCode() method looks suspicious. If the profile can be trusted, it seems to consume a significant share of the server's CPU. A BlockState object has two final fields: a Class and a String object. Therefore, the hashCode() method in BlockState will always return the same value when called on the same object multiple times. Maybe caching helps?

        1. Capture.PNG
          46 kB
          Donald Duck
        2. Capture.PNG
          99 kB
          Donald Duck
        3. Capture_hashCodeCalls_old.PNG
          55 kB
          Donald Duck
        4. Capture_hashCodeCalls_new.PNG
          33 kB
          Donald Duck
        5. Capture_alsoCachingBlockStateEnum_hashCode.PNG
          93 kB
          Donald Duck

            Assignee:
            Unassigned
            Reporter:
            Donald Duck
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: