zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

Improve `Literal` path matching via state machine

Open 987Nabil opened this issue 1 year ago â€ĸ 7 comments

Matching on path literals is currently done by set operations on a set of strings. The idea would be to improve this, by creating a state machine, that transitions to the next state based on the chars of all the possible alternative path segments. For example, if we have two segments on the same level aa and ab, we can only proceed if the first char is an a, the second a or b. Also we might be able to make a check based on the input length and fast exist if non of the possible segments has the same length.

This requires benchmarking first. So we can compare the current to the state machine version.

987Nabil avatar Jul 13 '24 09:07 987Nabil

/bounty $1250 for benchmarks and compilation to super fast state machines. Benchmarks should prove superior performance and happy path should be zero allocation, or as close as is theoretically possible.

jdegoes avatar Jul 30 '24 13:07 jdegoes

💎 $1,250 bounty â€ĸ ZIO

Steps to solve:

  1. Start working: Comment /attempt #2960 with your implementation plan
  2. Submit work: Create a pull request including /claim #2960 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bounty â€ĸ Share on socials

Attempt Started (GMT+0) Solution
🔴 @987Nabil Jul 30, 2024, 3:31:17 PM #3277
🔴 @hoklims Nov 23, 2024, 9:33:25 AM WIP
🔴 @promisingcoder Dec 12, 2024, 2:46:45 AM WIP

algora-pbc[bot] avatar Jul 30 '24 13:07 algora-pbc[bot]

/attempt #2960

Algora profile Completed bounties Tech Active attempts Options
@987Nabil    56 ZIO bounties
+ 1 bounty from 1 project
Scala
īšŸ1522
Cancel attempt

987Nabil avatar Jul 30 '24 15:07 987Nabil

@987Nabil: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Aug 06 '24 15:08 algora-pbc[bot]

The bounty is up for grabs! Everyone is welcome to /attempt #2960 🙌

algora-pbc[bot] avatar Aug 13 '24 15:08 algora-pbc[bot]

hey @987Nabil you working on these, i would like to do this ??

RohanMishra315 avatar Sep 12 '24 05:09 RohanMishra315

Yes, i am

987Nabil avatar Sep 12 '24 05:09 987Nabil

/attempt #2960

Options

hoklims avatar Nov 23 '24 09:11 hoklims

@hoklims: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Nov 30 '24 09:11 algora-pbc[bot]

The bounty is up for grabs! Everyone is welcome to /attempt #2960 🙌

algora-pbc[bot] avatar Dec 07 '24 09:12 algora-pbc[bot]

/attempt #2960

Options

promisingcoder avatar Dec 12 '24 02:12 promisingcoder

@jdegoes @987Nabil please review my pull request

promisingcoder avatar Dec 14 '24 00:12 promisingcoder

@vigoo

promisingcoder avatar Dec 14 '24 08:12 promisingcoder

Please do not attempt this issue anymore. I already came to a conclusion and I have JMH benchmarks implemented and some fixes that are unrelated to the issue but will make the routing faster. We are not able to use state machines. I leave this issue open until this changes are merged.

987Nabil avatar Dec 15 '24 06:12 987Nabil

@promisingcoder: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Dec 19 '24 02:12 algora-pbc[bot]

The bounty is up for grabs! Everyone is welcome to /attempt #2960 🙌

algora-pbc[bot] avatar Dec 26 '24 02:12 algora-pbc[bot]

💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Jan 18 '25 20:01 algora-pbc[bot]

🎉🎈 @987Nabil has been awarded $1,250! 🎈🎊

algora-pbc[bot] avatar Jan 22 '25 16:01 algora-pbc[bot]