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 regression in Stripe's codebase from Opus::Enum DSL #1664

Open
jez opened this issue Aug 28, 2019 · 0 comments
Open

Performance regression in Stripe's codebase from Opus::Enum DSL #1664

jez opened this issue Aug 28, 2019 · 0 comments
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers

Comments

@jez
Copy link
Collaborator

jez commented Aug 28, 2019

Problem

The changes introduced in #1480 have caused a significant performance regression in typechecking Stripe's codebase. Basically, by turning this:

class MyEnum < Opus::Enum
  A = new
  B = new
end

into this:

class MyEnum < Opus::Enum
  class A$1 < MyEnum; ...; end
  class B$1 < MyEnum; ...; end
end

It makes it so that none of the enum values can be resolved on the first pass of resolver, so they all have to be enqueued as AncestorResolutionItems.

Proposed solution

We believe that if the DSL pass would be rewritten to emit code like this:

class MyEnum < Opus::Enum; ...; end
class MyEnum::A$1 < MyEnum; ...; end
class MyEnum::B$1 < MyEnum; ...; end

Far fewer things would have to be queued up in resolver, which would make the time spent typechecking pay-server smaller.

@jez jez added enhancement New feature or surprising current feature good first issue Good for newcomers labels Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant