-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Long compilation time for large Carrays #98
Comments
This is probably a result of the code emitted by CBinding being rather redundant and relying on the Julia compiler optimizations to remove the redundancies. As the example below illustrates, the first time construction is 99.9% compilation time, but successive calls are much better. julia> module LargeArray
using CBinding
c``
c"""
typedef char LA[1024];
"""j
end
Main.LargeArray
julia> @time LargeArray.LA("example"...);
3.977991 seconds (2.29 M allocations: 211.621 MiB, 0.65% gc time, 99.92% compilation time)
julia> @time LargeArray.LA("example"...);
0.000050 seconds (109 allocations: 20.781 KiB) I will see about emitting more to-the-point code which doesn't use the compiler as a crutch. 😉 |
Thank you for your quick response! This a workaround a can work with for now! :-) |
It takes a lot of time to instantiate a parsed struct with very large char arrays.
Minimal example
It takes nearly 3 Minutes and a lots of RAM (it seems):
The text was updated successfully, but these errors were encountered: