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

Implement compile-time caching for Scala 3 #350

Open
neko-kai opened this issue Dec 4, 2022 · 6 comments
Open

Implement compile-time caching for Scala 3 #350

neko-kai opened this issue Dec 4, 2022 · 6 comments
Labels
💎 Bounty enhancement New feature or request good first issue Good for newcomers

Comments

@neko-kai
Copy link
Member

neko-kai commented Dec 4, 2022

We use caching to speed up LightTypeTag creation on Scala 2, we might want to port this technique to Scala 3 implementation also.

We can also Scala 2 improve Scala 2 caching, e.g. right now we cache individual AbstractReference's, but we don't cache basesDb or InheritanceDb (or we could cache the entire serialized LTT instead)

@jdegoes
Copy link
Member

jdegoes commented Nov 8, 2024

/bounty $250

Copy link

algora-pbc bot commented Nov 8, 2024

💎 $250 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #350 with your implementation plan
  2. Submit work: Create a pull request including /claim #350 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/izumi-reflect!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @asr2003 Nov 8, 2024, 9:52:52 PM WIP

@asr2003
Copy link

asr2003 commented Nov 8, 2024

/attempt #350

Algora profile Completed bounties Tech Active attempts Options
@asr2003    3 ZIO bounties
+ 5 bounties from 3 projects
Rust, Scala,
Go & more
Cancel attempt

@pshirshov
Copy link
Member

pshirshov commented Nov 9, 2024

@asr2003 : I'm glad you are willing to attempt solving this, a P/R which I would be happy to accept should include a benchmark proving that the cache actually works and is beneficial.

You may have a look at the current implementation in def makeRef(tpe: Type): AbstractReference.

So, the work on this issue should be done in 3 stages:

  1. We should introduce the same caching technique into the Scala 3 macro
  2. We should extend both macros in order to cache not just References but full Tags too
  3. We should introduce a simple benchmark showing the difference between caching and non-caching modes.

In my opinion, the benchmark is the most cumbersome part.

@pshirshov pshirshov added enhancement New feature or request good first issue Good for newcomers labels Nov 11, 2024
Copy link

algora-pbc bot commented Nov 15, 2024

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

Copy link

algora-pbc bot commented Nov 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants