Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2422

LABELED_PATH does not need to be added when a step label is not consumed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • process
    • None

    Description

      Currently `LABELED_PATH` requirement is added whenever a step under the traversal has any step label.

      But if the step label specified is not used, we actually don't need the requirement.
      By omitting unnecessary requirement we should be able to have some sort of performance gain (it varies depending on how query engine layer deals with TraverserRequirements).

       

      To achieve this, we may need some concise way to detect if following steps after the one produces the step label actually uses the label. Checking step one by one (e.g. `WherePredicateStep`, `PathStep`, etc) is error-prone and we may forget to add the handling when we add a new Step that consumes a step label.

      I talked with divijvaidya and possibly we can utilize `PATH` requirement - so whenever a step touches the labeled path the step adds `PATH` requirement to itself, then we can set `LABELED_PATH` req only when following steps has `PATH` requirement. More precisely it'd be better if we can retrieve what step label is used in a single common method and see the exact label used.

      Please let me know how you think.

      Attachments

        Activity

          People

            Unassigned Unassigned
            redtree1112 Norio Akagi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: