-
-
Notifications
You must be signed in to change notification settings - Fork 841
Implement basic function inlining #4677
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
base: main
Are you sure you want to change the base?
Conversation
2b1edb3
to
1d7e6d4
Compare
520c2b1
to
58adea1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing, and the code was such a pleasure to read!! I've left just a couple of nits
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1_5.snap
Outdated
Show resolved
Hide resolved
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test3.snap
Show resolved
Hide resolved
cb7f594
to
2596c4b
Compare
abe9223
to
e8a36da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, sorry for the uninvited comments! This is a really cool improvement and I was curious to peek behind the scenes...
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_call.snap
Outdated
Show resolved
Hide resolved
...m_core__erlang__tests__inlining__parameters_from_nested_functions_are_correctly_inlined.snap
Show resolved
Hide resolved
c2780c8
to
001d9ea
Compare
Not sure if this is the right way to go about it, but I've added a special |
646e9bd
to
e0bac83
Compare
This is looking really good! Have you done any measuring of the impact on this change on Gleam programs? Performance and code size are interesting, including with combinations of minification, gzip and/or brotoli for JavaScript. We want to make sure that we haven't in some places caused unexpected problems. |
326bfeb
to
d23376d
Compare
d23376d
to
336fd61
Compare
7222acc
to
2c3d3e4
Compare
Closes #3869
This PR implements the basic process of function inlining, without any heuristics to determine which functions to inline, we just use a hardcoded list.
The code for this is pretty much done, so please take a look, but before this is merged there's a few more things we should do:
result
andbool
combinators which seem to be the highest value but we should decide if there are any others we want to inline as well.javascript::tests::inlining
anderlang::tests::inlining
modules, but please suggest any other tests to write also. As well, we should run this version of the compiler on lots of existing packages to make sure nothing is broken.