-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Slow builds for larger resources embedded in code #75288
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
Comments
I hadn't even thought about compilation speed tbh. I wonder whether #68141 makes this better since we essentially generate a large array. |
FWIW. Somewhat subquadratic in debug mode, roughly linear in release mode.
|
I had a 1.2 MB JSON file (https://lua-api.factorio.com/latest/prototype-api.json), please note that |
I had a 9 megabyte file, the compiler aborts due to the type check taking too long. The generated file is a 30 megabyte swift file. |
If type checking is taking too long, I don't think there's anything specific to the package manager here. Moving the issue accordingly. |
I read somewhere that clang implemented the C Could Swift also do the same thing? Turning a 9 MB resource into a 30 MB generated file that then needs to be parsed and type-checked doesn't seem ideal. |
Rather than introduce a new language extension, the compiler could just flag during parsing "I have seen that all of these are byte constants" as an annotation, and proceed without the type resolver. |
Is there any progress on this? I keep trying to use this feature only to find out it's basically unusable. I really want to use this! |
Description
As suggested in the PR,
Resource.embedInCode(_:)
appears to be inefficient for larger resources.For a minimal
.executableTarget
with a 165 KB resource to be embedded, the debug build takes some 200 seconds on my machine. 19 seconds for the release build.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
Swift Package Manager version/commit hash
No response
Swift & OS version (output of
swift --version ; uname -a
)No response
The text was updated successfully, but these errors were encountered: