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

Performance Optimization: Avoid recalculating static information with each codec call #650

Closed
987Nabil opened this issue Jan 30, 2024 · 5 comments · Fixed by #656
Closed
Labels

Comments

@987Nabil
Copy link
Contributor

Currently, we have in a lot of codecs the same or similar calls. Like getting a chunk of fields to iterate over.
The usual way of using schemas is to have static once that never change during runtime. Therefor recalculating a collection of all fields or transient fields and so on, should be done once and not with every call of a codec operation.
For recursive / tree like structures this might need to be lazy.

  1. pre calculate needed information in the schema
  2. replace the code parts that calculate them on each call in the codecs with the pre calculated values to increase performance
@987Nabil 987Nabil added the enhancement New feature or request label Jan 30, 2024
@jdegoes
Copy link
Member

jdegoes commented Jan 30, 2024

/bounty $100

Copy link

algora-pbc bot commented Jan 30, 2024

💎 $100 bounty created by ZIO
🙋 If you start working on this, comment /attempt #650 along with your implementation plan
👉 To claim this bounty, submit a pull request that includes the text /claim #650 somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to zio/zio-schema!

👉 Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @987Nabil Jan 30, 2024, 9:21:43 AM #656

@987Nabil
Copy link
Contributor Author

987Nabil commented Jan 30, 2024

/attempt #650

Algora profile Completed bounties Tech Active attempts Options
@987Nabil    23 ZIO bounties
+ 0 bounties from 0 projects
Scala
Cancel attempt

Copy link

algora-pbc bot commented Jan 30, 2024

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

987Nabil added a commit to 987Nabil/zio-schema that referenced this issue Jan 30, 2024
987Nabil added a commit to 987Nabil/zio-schema that referenced this issue Jan 30, 2024
987Nabil added a commit to 987Nabil/zio-schema that referenced this issue Jan 31, 2024
987Nabil added a commit to 987Nabil/zio-schema that referenced this issue Jan 31, 2024
jdegoes pushed a commit that referenced this issue Feb 2, 2024
* Precalculate record field collections (#650)

* Extract common code for annotation based information (#650)
Copy link

algora-pbc bot commented Feb 2, 2024

🎉🎈 @987Nabil has been awarded $100! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants