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

surface (fix): Reduce the bytecode size of Surface.methodsOf for Scala 3 #3149

Merged
merged 20 commits into from
Aug 21, 2023

Conversation

xerial
Copy link
Member

@xerial xerial commented Aug 20, 2023

This fixes byte code too large error when using RxRouter.of[X] or Surface.methodsOf[X] when class X has many methods and repeated occurrences of the same parameters.

  • Bind surface to local lazy val __s000, __s001, ... and reference them when building other Surfaces and MethodSurfaces
    • Add a special handling for managing lazy surface
  • Fixes rx: RxOptionVar cannot be used in design #3131 as well
  • Reuse object methods when generating method accessor and object factory.

Other ideas

@github-actions github-actions bot added the bug label Aug 20, 2023
@xerial
Copy link
Member Author

xerial commented Aug 20, 2023

Other ideas

  • Use externally defined methods for field setter and object builder

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #3149 (4416b1e) into main (d9e3642) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 4416b1e differs from pull request most recent head 11cb3a4. Consider uploading reports for the commit 11cb3a4 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3149      +/-   ##
==========================================
- Coverage   82.89%   82.88%   -0.02%     
==========================================
  Files         350      350              
  Lines       14740    14743       +3     
  Branches     2443     2447       +4     
==========================================
+ Hits        12219    12220       +1     
- Misses       2521     2523       +2     
Files Changed Coverage Δ
...c/main/scala/wvlet/airframe/surface/Surfaces.scala 82.90% <0.00%> (-2.19%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9e3642...11cb3a4. Read the comment docs.

@xerial xerial marked this pull request as ready for review August 21, 2023 06:46
@xerial xerial changed the title surface (fix): Reduce bytecode size for Scala 3 surface (fix): Reduce the bytecode size of Surface.methodsOf for Scala 3 Aug 21, 2023
@xerial xerial merged commit 0b94a88 into main Aug 21, 2023
16 checks passed
@xerial xerial deleted the surface-code-gen-opt branch August 21, 2023 23:06
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 this pull request may close these issues.

surface: Remove redundant Surface generation in methodsOf[A] rx: RxOptionVar cannot be used in design
1 participant