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

perf(oxc_ast): optimize ast layout #5658

Closed
wants to merge 5 commits into from

Conversation

IWANABETHATGUY
Copy link
Contributor

@IWANABETHATGUY IWANABETHATGUY commented Sep 9, 2024

  1. as perf(ast): reduce AST memory usage #5601 (comment) suggested, this time only box FunctionBody.directives.
  2. Also change ast_tools to support auto generated Box<Vec<T>>

@github-actions github-actions bot added A-ast Area - AST A-codegen Area - Code Generation A-ast-tools Area - AST tools labels Sep 9, 2024
Copy link

graphite-app bot commented Sep 9, 2024

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

Add the label “0-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.

@IWANABETHATGUY IWANABETHATGUY force-pushed the perf/optimize-ast-layout2 branch from 81627eb to 941a6a9 Compare September 9, 2024 17:49
@IWANABETHATGUY IWANABETHATGUY changed the title perf: optimize ast layout perf(oxc_ast): optimize ast layout Sep 9, 2024
@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review September 9, 2024 17:56
Copy link

codspeed-hq bot commented Sep 9, 2024

CodSpeed Performance Report

Merging #5658 will not alter performance

Comparing perf/optimize-ast-layout2 (da01b26) with main (20a7861)

Summary

✅ 29 untouched benchmarks

@Boshen
Copy link
Member

Boshen commented Sep 10, 2024

Box<Vec<_>> feels weird, let me think about this.

@Boshen Boshen marked this pull request as draft September 10, 2024 01:10
@IWANABETHATGUY
Copy link
Contributor Author

Box<Vec<_>> feels weird, let me think about this.

#5601 (comment))

@IWANABETHATGUY IWANABETHATGUY deleted the perf/optimize-ast-layout2 branch September 10, 2024 13:16
@overlookmotel
Copy link
Contributor

A ThinVec type would be preferable for this use case (oxc-project/backlog#113). But who knows when we'll get around to implementing that?

In the meantime, I think Box<Vec<T>> is the best solution we have available.

Personally I think we should consider re-opening this and likely merging it. At the very least, the changes to ast_tools and the Traverse codegen are worthwhile. @Boshen?

@IWANABETHATGUY IWANABETHATGUY restored the perf/optimize-ast-layout2 branch September 13, 2024 02:37
@IWANABETHATGUY IWANABETHATGUY force-pushed the perf/optimize-ast-layout2 branch from 0dd48dd to da01b26 Compare September 13, 2024 02:37
@Boshen
Copy link
Member

Boshen commented Sep 13, 2024

A ThinVec type would be preferable for this use case (oxc-project/backlog#113). But who knows when we'll get around to implementing that?

In the meantime, I think Box<Vec<T>> is the best solution we have available.

Personally I think we should consider re-opening this and likely merging it. At the very least, the changes to ast_tools and the Traverse codegen are worthwhile. @Boshen?

<Box<Vec_>> looks too strange, and there is no observable performance impact to get this merged.

@Boshen Boshen deleted the perf/optimize-ast-layout2 branch September 18, 2024 14:19
@overlookmotel
Copy link
Contributor

@IWANABETHATGUY I'm sorry I "led you up the garden path" with my comment #5601 (comment). It seems Boshen and I disagree on this one. It's unfortunate we didn't realize that before you started on PRs. Sorry.

@IWANABETHATGUY
Copy link
Contributor Author

@IWANABETHATGUY I'm sorry I "led you up the garden path" with my comment #5601 (comment). It seems Boshen and I disagree on this one. It's unfortunate we didn't realize that before you started on PRs. Sorry.

that's fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ast Area - AST A-ast-tools Area - AST tools A-codegen Area - Code Generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants