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

meta: compiler performance #4272

Open
charles-cooper opened this issue Oct 4, 2024 · 1 comment
Open

meta: compiler performance #4272

charles-cooper opened this issue Oct 4, 2024 · 1 comment

Comments

@charles-cooper
Copy link
Member

this is a tracking issue to keep track of compiler performance.

the following numbers are for a fairly large, single file vyper contract (2k loc, near 24kb limit).

some hotspots:

  • vyper initialization. costs 200ms just to run vyper --help

    • some of this probably comes from dataclass initialization
    • e.g. calling dataclass() on a simple class costs 180us
  • parse_to_ast has hotspots in tokenize() and ASTTokens.mark_tokens() - total 300ms

  • semantic analysis is relatively cheap, 240ms

  • translation to IRnodes, 600ms

  • biggest hotspot is in legacy IR optimizer, due to all the calls to IRnode.from_list() - 1.7s (1700ms)

  • venom (optional) - 1.1s (1100ms), although this changes fairly rapidly depending what we are doing with the passes

while the frontend looks cheaper, note that it scales with the size of all imports (source code), while code generation scales with contract size.

@harkal
Copy link
Collaborator

harkal commented Oct 5, 2024

As we move away from the legacy IR optimizer, we are going to get a lot of extra margin for venom, which I am confident we will be able to make better use of. I feel confident about this, as for venom I never optimized for speed up until this point. My only goal is the efficiency of the generated code.

p.s. so no rewrites in zig just yet ::D

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

No branches or pull requests

2 participants