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

Minor: inline unwrap_arc, rewrite_arc, rewrite_arcs #11005

Closed
wants to merge 2 commits into from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jun 19, 2024

Which issue does this PR close?

Part of #5637

Closes #.

Rationale for this change

When profiling on main these functions show up many times
Screenshot 2024-06-19 at 11 13 16 AM

What changes are included in this PR?

Changes
Mark the functions as #[inline(always)] - I think they are not inlined without the #inline attribute as they are in different crates

This makes the profiles much easier to read and understand:

Screenshot 2024-06-19 at 10 39 30 AM

Are these changes tested?

Functionally by exisitng tests

Performance:
(performance measurements in progress)

Code size:

I also made sure this didn't bloat the binary size:

cd datafusion-cli
cargo build --release

Before this PR:
TODO

After this PR:
TODO

Are there any user-facing changes?

Hopefuly

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jun 19, 2024
@alamb
Copy link
Contributor Author

alamb commented Jun 19, 2024

🤔 I see an error now

  Running tests/tpcds_planning.rs (target/debug/deps/tpcds_planning-cfb56ce58344e128)

running 198 tests
test tpcds_logical_q12 ... ok
test tpcds_logical_q1 ... ok
test tpcds_logical_q10 ... ok

thread 'tpcds_logical_q14' has overflowed its stack
fatal runtime error: stack overflow
error: test failed, to rerun pass `-p datafusion --test tpcds_planning`

@jayzhan211
Copy link
Contributor

I think inline may also cause code bloat, especially there is recursive call for unwrap_***, worth to check it too.

@alamb
Copy link
Contributor Author

alamb commented Jun 20, 2024

Good call @jayzhan211 -- I will double check the size of the generated code before putting this PR up for review

@alamb alamb closed this Jul 31, 2024
@alamb
Copy link
Contributor Author

alamb commented Jul 31, 2024

I realstically will not have time to work on this any time soon

@alamb alamb reopened this Jul 31, 2024
@alamb alamb closed this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants