8000 More function overloading in output by laurentlb · Pull Request #465 · laurentlb/shader-minifier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

More function overloading in output #465

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

Merged
merged 5 commits into from
Apr 6, 2025
Merged

More function overloading in output #465

merged 5 commits into from
Apr 6, 2025

Conversation

laurentlb
Copy link
Owner
@laurentlb laurentlb commented Oct 2, 2024

Function overloading makes the code much more compressible, as many functions will have the same name (assuming that the file has many functions). When tested on an 8kB intro, this change saved 100 bytes (after compression). Some users reported modest gains on 4kB intros.

Fixes #383

@therontarigo
Copy link
Contributor

Are we any closer to the minifier having full visibility into expression types?

@laurentlb
Copy link
Owner Author

No. This optimization doesn't actually need type information (it just looks at the function signature and decides if overloading is possible).

We can discuss expression types in a separate issue (I don't think it's difficult to do).

laurentlb added a commit to ctrl-alt-test/moto that referenced this pull request Oct 3, 2024
- This includes aggressive overloading of functions
(laurentlb/shader-minifier#465)
@laurentlb laurentlb marked this pull request as ready for review April 6, 2025 15:00
@laurentlb
Copy link
Owner Author

I've updated the PR, with tests and documentation. Compression tests show it's very useful.

@laurentlb laurentlb changed the title Draft: more function overloading in output More function overloading in output Apr 6, 2025
@laurentlb laurentlb merged commit 431bc79 7C77 into master Apr 6, 2025
1 check passed
@laurentlb laurentlb deleted the overload branch April 6, 2025 16:01
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

Successfully merging this pull request may close these issues.

Renaming: allow type-overloading
3 participants
0