Reduce time blocking the ClassSpecializer cache creating SpeciesData

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 11
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      ClassSpecializer.findSpecies uses computeIfAbsent to create an instance of and then load and link a SpeciesData class. The loading and linking might be a non-trivial operation, which means the ConcurrentHashMap used as a SpeciesData cache in ClassSpecializer could be partially blocked for longer than necessary. It also prohibits the loading/linking operation from relying on another species, since that would lead to a recursive update of the CHM from the same thread.

      The instantiation of SpeciesData and the initialization thereof (if needed) should be split out so that the latter takes place after the computeIfAbsent.

            Assignee:
            Claes Redestad
            Reporter:
            Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: