Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-194

Minor optimization: TrailingEntityMapSupport.getTrailingEntity(PlanningVariableDescriptor,Object) creates new iterator

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Minor
    • 6.1.0.CR1
    • 6.0.0.CR1
    • optaplanner-core
    • None

    Description

      TrailingEntityMapSupport#getTrailingEntity(PlanningVariableDescriptor,Object)
      Creates a new iterator for each call to just retrieve the first object using next()

      Wouldn't a more efficient data structure instead of Map<Object, Set<Object>> be faster and produce less garbage? (a list or a single object as value, especially because if the set has size()>1 throws exception anyway)

      Attachments

        Activity

          People

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            romanstumm Roman Stumm (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: