Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use flat array for field indexing instead of hashmap #247

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

Conversation

ProBrian
Copy link

@ProBrian ProBrian commented Sep 4, 2024

To resolve KAG-5155

@CLAassistant
Copy link

CLAassistant commented Sep 4, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Sep 4, 2024

Luacheck Report

3 tests   3 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 0600b83.

♻️ This comment has been updated with latest results.

src/context.rs Show resolved Hide resolved
src/context.rs Show resolved Hide resolved
src/router.rs Outdated Show resolved Hide resolved
src/router.rs Outdated Show resolved Hide resolved
lib/resty/router/context.lua Outdated Show resolved Hide resolved
@ProBrian ProBrian marked this pull request as draft September 9, 2024 03:50
src/context.rs Show resolved Hide resolved
@dndx
Copy link
Member

dndx commented Oct 16, 2024

@ProBrian This PR need to be rebased

@ProBrian
Copy link
Author

ProBrian commented Oct 30, 2024

Local benchmark result attached (MacOS M3 chip with 36GB mem), comparing with PR branch and main branch

 Running benches/build.rs (target/release/deps/build-3f0a7ade35c0c7a4)
New: Build Router            time:   [3.0939 ms 3.1021 ms 3.1114 ms]
Old: Build Router            time:   [3.1140 ms 3.1375 ms 3.1765 ms]
                        change: [+1.2814% +2.1473% +3.3212%] (p = 0.00 < 0.05)

 
     Running benches/match_mix.rs (target/release/deps/match_mix-8ebfb4b8ad1a6fd2)
New: Match                   time:   [36.678 ns 36.807 ns 36.991 ns]
Old: Match                   time:   [56.656 ns 56.897 ns 57.178 ns]
                        change: [+10.838% +11.498% +12.176%] (p = 0.00 < 0.05)

 
     Running benches/misc_match.rs (target/release/deps/misc_match-ef04ce8d11de66a9)
  New:  route match all         time:   [89.362 ns 89.910 ns 90.633 ns]
  Old: route match all         time:   [103.81 ns 104.00 ns 104.17 ns]
 
New: route mismatch all      time:   [123.28 ns 123.52 ns 123.80 ns]
Old: route mismatch all      time:   [225.65 ns 226.23 ns 226.94 ns]

 
New: route matchers batch create and delete
                        time:   [20.357 ms 20.448 ms 20.555 ms]
Old: route matchers batch create and delete
                        time:   [19.954 ms 20.100 ms 20.272 ms]

 
     Running benches/not_match_mix.rs (target/release/deps/not_match_mix-8894a45acea74fc2)
New: Doesn't Match           time:   [13.551 ms 13.624 ms 13.715 ms]
Old: Doesn't Match           time:   [21.577 ms 22.097 ms 22.635 ms]

 
     Running benches/string.rs (target/release/deps/string-4f7ea951a6e3683d)
New: Doesn't Match           time:   [10.536 ms 10.571 ms 10.615 ms]
Old: Doesn't Match           time:   [14.018 ms 14.069 ms 14.125 ms]

 
     Running benches/test.rs (target/release/deps/test-1f097a0352e64a6c)
New: Doesn't Match           time:   [35.154 ms 35.342 ms 35.552 ms]
Old: Doesn't Match           time:   [35.460 ms 35.740 ms 36.037 ms]

@ProBrian
Copy link
Author

ProBrian commented Dec 16, 2024

@dndx @ADD-SP Are there new comments on this PR?

@StarlightIbuki
Copy link

Please resolve conflicts

@ProBrian
Copy link
Author

Please resolve conflicts

Conflicts caused due to the revert introduced by #284, we should figure out if that reverted change will be committed back after the investigation of 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.

6 participants