Opened 7 years ago

Last modified 7 years ago

#763 assigned optimization

ACI-, SRT- and REG-expressions shall get precompiled

Reported by: westram Owned by: westram
Priority: major Milestone:
Component: Library (DB) Version: SVN
Keywords: aci Cc:

Description (last modified by westram)

Advantage: better performance (esp. for NDS, search tool, modify fields)

General concept:

All these expressions

  • take an input string + an execution environment and
  • produce an output string.

All sub-commands of a "normal ACI expression" do the same, with the difference, that they take/produce multiple I/O-streams (=strings).

Precompiled expression:

consists of

  • name (or expression or both)
  • function-pointer
  • list of parameters (type: string or precompiled sub-expression)
    • type is only known by function
      (e.g. arguments to binary operators like plus are ACI-expressions)
      ⇒ function needs permission to convert (string→precompiled expression)

Execution environment:

existing environment:

  • the given item (e.g. species; optional)
  • the name of the current tree (optional)
  • database (gb_main)
  • execution state (error)
  • trace mode

Optional data might be expected by some ACI-commands (tree/item).

Shall also store caller-defined data (see #756).

Related data:

  • current input- and output-streams

Notes:

  • REG-expressions are already able to get precompiled.
    There are 2 types of REG-expressions:
    • REG-match (e.g. /^hi.*light/[flag]) - precompile available
    • REG-replace (e.g. /old/new/[flag]) - precompile needs to get separated from execution
  • SRT - no precompile available yet; maybe only split into single replace-ops
  • ACI
    • implicit (unnamed) commands:
      • queue (e.g. |"[";dd;"]"; each part of queue applied to all input-streams)
      • text (e.g. "["; ignores all input streams, writes one fixed output stream)
      • pipe (e.g. |len|minus(5); first part of pipe applied to all input-streams, other parts applied to output-streams of preceding part)

Change History (2)

comment:1 Changed 7 years ago by westram

  • Description modified (diff)
  • Status changed from new to accepted

comment:2 Changed 7 years ago by westram

  • Status changed from accepted to assigned
Note: See TracTickets for help on using tickets.