Skip to content

feat: Use a bitset to represent the set of transformations#333

Draft
Dr-Emann wants to merge 2 commits intoKong:mainfrom
Dr-Emann:push-mvyrmqpmwvxr
Draft

feat: Use a bitset to represent the set of transformations#333
Dr-Emann wants to merge 2 commits intoKong:mainfrom
Dr-Emann:push-mvyrmqpmwvxr

Conversation

@Dr-Emann
Copy link
Contributor

@Dr-Emann Dr-Emann commented Jan 16, 2026

This is a breaking change from the rust side, at least, since it changes publicly exported types (LhsTransformations and the transformations field of the Lhs type), so I bumped the version to 2.0. I'm not sure if we should really be exposing all these types and fields publicly (or if we even consider the rust API part of semver).

This has a mild but consistent perf improvement with the benchmarks:

     Running benches/build.rs (target/release/deps/build-7c4a2d11080689ae)
Build Router            time:   [3.5907 ms 3.5968 ms 3.6035 ms]
                        change: [−4.3578% −4.0135% −3.6584%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe

     Running benches/match_mix.rs (target/release/deps/match_mix-ad74be14abd29154)
Match                   time:   [75.501 ns 75.606 ns 75.721 ns]
                        change: [−2.5543% −2.2070% −1.8833%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

Doesn't Match           time:   [15.672 ms 15.712 ms 15.752 ms]
                        change: [−34.306% −34.101% −33.937%] (p = 0.00 < 0.05)
                        Performance has improved.

This is a breaking change from the _rust_ side, at least, since it
changes publicly exported types (`LhsTransformations` and the
`transformations` field of the `Lhs` type)
Copy link

@StarlightIbuki StarlightIbuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I do not yet have time for an accurate bench. Maybe later, I will add a report of its improvement on Kong's overall performance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants