Skip to content

perf(core): targeting rule matching 2.7–4.6 % slower than 0.1.31 #72

Open

Description

@akosidencio

In the dedicated-host Linux A/B for 0.2.0 (scripts/release-benchmarks/v0.2.0-linux.sh, v0.1.31 33b9d5f vs candidate ca3dcc7, 6-CPU workstation, 5-round core rerun), rule matching in the Rust core is measurably slower:

Benchmark (median of runs) v0.1.31 0.2.0 Ratio [95 % CI]
Core targeting, 1 rule 79.9 ns 82.1 ns 1.027 [1.014, 1.041]
Core targeting, 10 rules 228.4 ns 238.8 ns 1.046 [1.031, 1.055]

Both results are inside the 10 % release threshold and were accepted for 0.2.0. The cost does not show in the Node SDK (the N-API boundary dominates) or in any server metric. The likely source is the 0.2.0 evaluator refactor that made evaluation generic over a trace recorder for explain(). This has not been confirmed.

Acceptance criteria

  • Root cause identified (e.g. profile evaluate_variant with and without the trace recorder) and written up in this issue.
  • On the same harness and host class, both targeting benchmarks have a ratio vs v0.1.31 whose 95 % CI upper bound is ≤ 1.010 (that is, no measurable slowdown above 1 %).
  • No other core, Node, snapshot or SSE benchmark regresses by more than 1 % (CI upper bound).
  • explain() output is unchanged: shared evaluation vectors (sdks/conformance/vectors/evaluation.json) pass in core, Node, Python and OpenFeature.

Activity

  1. added this to the v0.2.1 milestone on Nov 22, 2026
  2. added
    enhancement
    on Nov 22, 2026
  3. added a commit that references this issue on Nov 30, 2026
  4. modified the milestones: v0.2.1, v0.2.2 on Nov 30, 2026
  5. akosidencio commented on Nov 30, 2026

    @akosidencio
    MemberAuthor

    Partially resolved in 0.2.1, so this stays open (moved to v0.2.2).

    What 0.2.1 fixes (#102): the root cause is understood and fixed. Since 0.2.0 the generic evaluator is instantiated twice (plain evaluation and explain()), so rule_matches gained a second caller and the compiler stopped inlining it into the rule loop. That cost a function call per rule. It is now #[inline(always)], as the code behaved in 0.1.31. Evaluation results are unchanged.

    What remains: qualifying the result on the dedicated Linux benchmark host. Local (macOS) measurements are too noisy for the 1 % gate. With 10 rules the result is level with 0.1.31 within noise; the 1-rule case still reads about 3 % behind 0.1.31 locally, and prerequisite_chain_5 about 2 % behind 0.2.0. Every case is inside the 10 % release threshold. The maintainer waived dedicated-host qualification for 0.2.1.

    To close: a controlled A/B on the dedicated host (final vs v0.1.31 and vs v0.2.0, targeting and prerequisite-chain benchmarks) showing the targeting cases within the gate.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions