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

Possible performance improvements #602

Open
MateuszKubuszok opened this issue Sep 25, 2024 · 0 comments
Open

Possible performance improvements #602

MateuszKubuszok opened this issue Sep 25, 2024 · 0 comments
Labels
breaking change Change resulting in compilation errors of code that used to be considered correct, or linking errors enhancement

Comments

@MateuszKubuszok
Copy link
Member

We are using Vector[Any] for building and storing the collection of overrides (both constant values and functions). Inside def addOverride we are using with +:.

  • we might consider modifying the code to use :+ append instead instead - as it might be faster
  • since TransformationContext does not depend on RuntimeDataStore we might also consider converting Vector to Array in some cases - inside the macro, once the Vector has all the values
  • we might consider replacing Vector with some custom data structure that would be e.g. cheap to append, and on the first access computed internally an Array,
  • any such change should still pass the tests and be verified with benchmarks - it might be possible that we would actually de-optimize the code or introduce a risky change without any benefits
    • if we consider compatibility issues - changing the +: to :+ happens inside the library code that could be evicted, but calling the apply(index) happens in the generated code that will stay the same, so it's a change that could be safely done only be recompiling the code, so it's a breaking change that could be introduced in future 2.0.0 release.
@MateuszKubuszok MateuszKubuszok added enhancement breaking change Change resulting in compilation errors of code that used to be considered correct, or linking errors labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Change resulting in compilation errors of code that used to be considered correct, or linking errors enhancement
Projects
None yet
Development

No branches or pull requests

1 participant