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

Build single token -> address map #978

Merged
merged 2 commits into from
Jun 11, 2024
Merged

Build single token -> address map #978

merged 2 commits into from
Jun 11, 2024

Conversation

Jake-Shadle
Copy link
Collaborator

Resolves: #975

@XAMPPRocky
Copy link
Collaborator

Have you run any benchs on this to see if and/or how fast it is compared to the previous approach?

@Jake-Shadle
Copy link
Collaborator Author

main

token_router                      fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ token_router                                 │               │               │               │         │
   ├─ HashedTokenRouter                         │               │               │               │         │
   │  ├─ multi:2..128:duplicates  1.572 µs      │ 36.19 µs      │ 13.61 µs      │ 14.29 µs      │ 100     │ 100
   │  │                           67.36 TB/s    │ 2.927 TB/s    │ 7.781 TB/s    │ 7.414 TB/s    │         │
   │  ├─ multi:2..128:unique      1.432 µs      │ 44.41 µs      │ 13.93 µs      │ 15.04 µs      │ 100     │ 100
   │  │                           73.91 TB/s    │ 2.384 TB/s    │ 7.601 TB/s    │ 7.04 TB/s     │         │
   │  ├─ single:duplicates        1.021 µs      │ 19.84 µs      │ 6.211 µs      │ 6.677 µs      │ 100     │ 100
   │  │                           1.608 TB/s    │ 82.79 GB/s    │ 264.5 GB/s    │ 246 GB/s      │         │
   │  ╰─ single:unique            720.7 ns      │ 25.44 µs      │ 5.725 µs      │ 6.49 µs       │ 100     │ 100
   │                              2.28 TB/s     │ 64.58 GB/s    │ 287 GB/s      │ 253.2 GB/s    │         │
   ╰─ TokenRouter                               │               │               │               │         │

PR

token_router                      fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ token_router                                 │               │               │               │         │
   ├─ HashedTokenRouter                         │               │               │               │         │
   │  ├─ multi:2..128:duplicates  700.7 ns      │ 5.058 µs      │ 961.2 ns      │ 1.044 µs      │ 100     │ 100
   │  │                           151.2 TB/s    │ 20.94 TB/s    │ 110.2 TB/s    │ 101.4 TB/s    │         │
   │  ├─ multi:2..128:unique      690.7 ns      │ 4.237 µs      │ 931.7 ns      │ 1.008 µs      │ 100     │ 100
   │  │                           153.3 TB/s    │ 24.99 TB/s    │ 113.6 TB/s    │ 104.9 TB/s    │         │
   │  ├─ single:duplicates        490.7 ns      │ 3.606 µs      │ 780.7 ns      │ 822.4 ns      │ 100     │ 100
   │  │                           3.348 TB/s    │ 455.5 GB/s    │ 2.104 TB/s    │ 1.997 TB/s    │         │
   │  ╰─ single:unique            480.7 ns      │ 3.446 µs      │ 790.7 ns      │ 814.7 ns      │ 100     │ 100
   │                              3.418 TB/s    │ 476.8 GB/s    │ 2.078 TB/s    │ 2.017 TB/s    │         │
   ╰─ TokenRouter                               │               │               │               │         │

@Jake-Shadle Jake-Shadle enabled auto-merge (squash) June 11, 2024 13:47
@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 82b2c7ff-429d-4815-b45d-b3530cdb90b9

The following development images have been built, and will exist for the next 30 days:

To build this version:

git fetch git@github.com:googleforgames/quilkin.git pull/978/head:pr_978 && git checkout pr_978
cargo build

@XAMPPRocky
Copy link
Collaborator

XAMPPRocky commented Jun 11, 2024

Nice, 2x as fast 😄 And much better in the slowest.

@Jake-Shadle Jake-Shadle merged commit 8f118a0 into main Jun 11, 2024
12 checks passed
@Jake-Shadle Jake-Shadle deleted the token-mapping branch June 11, 2024 16:29
@markmandel
Copy link
Contributor

Any reason to keep the default TokenRouter? Seems like HashedTokenRouter should just become the TokenRouter?

@Jake-Shadle
Copy link
Collaborator Author

Yes.

@markmandel markmandel added kind/feature New feature or request and removed kind/other labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use token -> endpoint mapping in token router
4 participants