Skip to content

pref(ast): inline visit walks with small bodies.#4009

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-01-pref_ast_improve_the_performance_of_visitors
Jul 2, 2024
Merged

pref(ast): inline visit walks with small bodies.#4009
graphite-app[bot] merged 1 commit intomainfrom
07-01-pref_ast_improve_the_performance_of_visitors

Conversation

@rzvxa
Copy link
Contributor

@rzvxa rzvxa commented Jul 1, 2024

Attempt to improve the performance of visitors, It is mostly for experiments. I'm not sure how much performance is there to gain back.

  • inline plural visits (eg: visit_statements)
  • inline enums when there are 5 or fewer match cases
  • inline structs when there are 5 or less fields
  • inline Visit::alloc

@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 1, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 1, 2024

CodSpeed Performance Report

Merging #4009 will improve performances by 4.35%

Comparing 07-01-pref_ast_improve_the_performance_of_visitors (352c0b4) with 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors (b51f75b)

Summary

⚡ 2 improvements
✅ 26 untouched benchmarks

Benchmarks breakdown

Benchmark 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors 07-01-pref_ast_improve_the_performance_of_visitors Change
prepass[react.development.js] 229.2 µs 219.6 µs +4.35%
prepass[typescript.js] 30.1 ms 29 ms +3.74%

@rzvxa rzvxa marked this pull request as ready for review July 1, 2024 19:49
@rzvxa rzvxa changed the title pref(ast): improve the performance of visitors. pref(ast): inline visit walks with small bodies. Jul 1, 2024
@DonIsaac DonIsaac added the C-performance Category - Solution not expected to change functional behavior, only performance label Jul 1, 2024
@rzvxa rzvxa force-pushed the 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors branch from 70f4c5d to 50a02c0 Compare July 2, 2024 08:56
@rzvxa rzvxa force-pushed the 07-01-pref_ast_improve_the_performance_of_visitors branch from 650823a to 539783a Compare July 2, 2024 08:56
@rzvxa rzvxa force-pushed the 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors branch from 50a02c0 to ecfc5ed Compare July 2, 2024 09:01
@rzvxa rzvxa force-pushed the 07-01-pref_ast_improve_the_performance_of_visitors branch from 539783a to 9fcc980 Compare July 2, 2024 09:01
@rzvxa rzvxa force-pushed the 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors branch from ecfc5ed to 0790753 Compare July 2, 2024 09:04
@rzvxa rzvxa force-pushed the 07-01-pref_ast_improve_the_performance_of_visitors branch from 9fcc980 to 2fbe2bd Compare July 2, 2024 09:04
@rzvxa rzvxa force-pushed the 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors branch from 0790753 to 40e3abd Compare July 2, 2024 09:53
@rzvxa rzvxa force-pushed the 07-01-pref_ast_improve_the_performance_of_visitors branch from 2fbe2bd to 0b0802d Compare July 2, 2024 09:53
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 2, 2024 — with Graphite App
@rzvxa rzvxa force-pushed the 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors branch from 40e3abd to aecfe35 Compare July 2, 2024 10:09
@rzvxa rzvxa force-pushed the 07-01-pref_ast_improve_the_performance_of_visitors branch from 0b0802d to 3d71263 Compare July 2, 2024 10:09
@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 2, 2024

Merge activity

~~Attempt to improve the performance of visitors, It is mostly for experiments. I'm not sure how much performance is there to gain back.~~

- [x] inline plural visits (eg: visit_statements)
- [x] inline enums when there are 5 or fewer match cases
- [x] inline structs when there are 5 or less fields
- [x] inline `Visit::alloc`
@Boshen Boshen force-pushed the 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors branch from aecfe35 to b51f75b Compare July 2, 2024 10:21
@Boshen Boshen force-pushed the 07-01-pref_ast_improve_the_performance_of_visitors branch from 3d71263 to 352c0b4 Compare July 2, 2024 10:22
@Boshen Boshen changed the base branch from 07-01-refactor_ast_codegen_no_longer_outputs_discard_variable_for_empty_visitors to main July 2, 2024 10:45
@graphite-app graphite-app bot merged commit 352c0b4 into main Jul 2, 2024
@graphite-app graphite-app bot deleted the 07-01-pref_ast_improve_the_performance_of_visitors branch July 2, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-ast Area - AST C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants