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

Pre-generate DynamicScope shapes at build time #5761

Merged
merged 1 commit into from Jun 7, 2019

Conversation

@headius
Copy link
Member

@headius headius commented Jun 4, 2019

This PR pregenerates all DynamicScope subclasses we normally generate at runtime. The classes are included in the JRuby jar file so none of these classes are generated at runtime.

The logic here uses the max generated size as the max to pregenerate, resulting in no runtime generation happening. Currently, we generate up to 50-wide, so this PR currently generates 51 classes into JRuby.jar. Typical Ruby code will use only the smallest sizes, so this may be wasteful. The full set of 51 classes increases the size of my local jruby.jar by about 90k.

We may want to consider pregenerating fewer classes (if the size of the jar is important) as well as possibly generating fewer shapes overall (since there are diminishing returns to create e.g. a 50-wide scope class that's only used for one method).

This avoids generating them at runtime. Currently this is set to
pregenerate all sizes which we would have generated at runtime,
which currently is set to 50.
@headius headius added this to the JRuby 9.2.8.0 milestone Jun 4, 2019
@headius headius requested review from enebo and kares Jun 4, 2019
enebo
enebo approved these changes Jun 5, 2019
kares
kares approved these changes Jun 5, 2019
@headius headius merged commit 164a621 into jruby:master Jun 7, 2019
1 of 2 checks passed
Loading
@headius headius deleted the pregen_dynscope branch Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants