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

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

XMLWordPrintable

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

      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)

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

                Created:
                Updated:
                Resolved: