Skip to content

[enhancement] Add peephole optimizations to generated BDD code #4797

Description

@ysaito1001

Optimizations involve

  • Coalesce and ite functions should never show up in generated code.
  • Add explicit peephole optimizations that prevent allocations for things like substrings.

For example, instead of

private boolean cond6() {
    return ("--x-s3".equals(RulesFunctions.coalesce(RulesFunctions.substring(params.bucket(), 0, 6, true), "")));
}

code generate this instead:

private boolean cond6() {
    return (params.bucket() != null && params.bucket().endsWith("--x-s3"));
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions