-
Notifications
You must be signed in to change notification settings - Fork 8
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
Very long build times for anything besides a trivial specification #1293
Comments
Hi Daly, This is not a known problem. Typically, the compilation takes only a couple of seconds on a modern workstation, even for code generated from a complex specification. In the past, we have observed that certain compiler flags can negatively affect the compilation time, but the resulting compilation time was always still in the order of minutes, not hours. Which toolchain are you using? Do you use specific compiler flags? Could you provide a small reproducer, where this issue can be observed? |
Thanks for the quick reply. It seemed off to me too - I expect a few seconds to a few minutes to build. I can put together a reproducer and send to you this week. Here are the compiler flags I am running with at the moment (I use "-Og" -- Optimize for debug
,"-ffunction-sections" -- Separate ELF section for each function
,"-fdata-sections" -- Separate ELF section for each variable
,"-g" -- Generate debug info
,"-gnatwa" -- Enable all warnings
,"-gnatw.X" -- Disable warnings for No_Exception_Propagation
,"-gnatVa" -- All validity checks
,"-gnaty3" -- Specify indentation level of 3
,"-gnatya" -- Check attribute casing
,"-gnatyA" -- Use of array index numbers in array attributes
,"-gnatyB" -- Check Boolean operators
,"-gnatyb" -- Blanks not allowed at statement end
,"-gnatyc" -- Check comments
,"-gnaty-d" -- Disable check no DOS line terminators present
,"-gnatye" -- Check end/exit labels
,"-gnatyf" -- No form feeds or vertical tabs
,"-gnatyh" -- No horizontal tabs
,"-gnatyi" -- Check if-then layout
,"-gnatyI" -- check mode IN keywords
,"-gnatyk" -- Check keyword casing
,"-gnatyl" -- Check layout
,"-gnatym" -- Check maximum line length
,"-gnatyn" -- Check casing of entities in Standard
,"-gnatyO" -- Check that overriding subprograms are explicitly marked as such
,"-gnatyp" -- Check pragma casing
,"-gnatyr" -- Check identifier references casing
,"-gnatyS" -- Check no statements after THEN/ELSE
,"-gnatyt" -- Check token spacing
,"-gnatyu" -- Check unnecessary blank lines
,"-gnatyx" -- Check extra parentheses
,"-gnatX" -- Enable GNAT Extensions I should mention I'm using a Debian based docker container run on a Mac M1 (so the Debian container is an I'm using the following version of
I'm using the latest version of I'll make a reproducer that is a bit simpler than what I have but still demonstrates what is happening. |
Here is a very basic example: this reproducer will only take a couple of minutes to build for me, but it shows the issue starting to creep in. Maybe I am not using the generated code properly and that is the issue. To really expose my issue, I can add in more conditionals on the transitions and more fields in the messages to really highlight it (and make it more similar to the real messages we are trying to model). I'll hold off on that if this reproducer is good enough. Let me know, thanks! |
Thank you for the reproducer. A build time of a couple of minutes is much longer than we have seen with much more complicated specifications. We will investigate and let you know when we know more. |
Thanks! And to be clear: I trimmed this down quite a bit from the real application we are building. The message structure is similar but larger and more complicated and building takes 1 hour++. |
The long compilation time is caused by the use of the |
Ahhhh thanks! Doh! I should of tried that instead of trying a bunch of other flags. |
I should mention the same issue occurs with |
Also, to avoid creating another issue, I've had problems with some more compiler switches:
procedure Initialize (Ctx : out Context; Buffer : in out RFLX_Types.Bytes_Ptr) with
Pre =>
(not Ctx'Constrained
and then Buffer /= null
and then Buffer'Length > 0
and then Buffer'Last < RFLX_Types.Index'Last),
Post =>
(Has_Buffer (Ctx)
and Valid (Ctx)
and Buffer = null
and Ctx.Buffer_First = Buffer'First'Old
and Ctx.Buffer_Last = Buffer'Last'Old
and Ctx.First = RFLX_Types.To_First_Bit_Index (Ctx.Buffer_First)
and Ctx.Last = RFLX_Types.To_Last_Bit_Index (Ctx.Buffer_Last)
and Sequence_Last (Ctx) = Ctx.First - 1),
Depends =>
(Ctx => Buffer, Buffer => null); Cheers! |
I already have seen some style check warnings in your reproducer. These warnings were caused by the use of
I cannot reproduce the issue with RecordFlux 0.15.0. Please check if upgrading RecordFlux solves the issue for you.
I have seen this warning when using |
Awesome - thanks for the response! We are using |
After updating to Thanks for everything! |
You are welcome! I'm glad to hear that most of your issues have been resolved in the new version. We will probably also fix the style check problem soon. |
Ref. #1293, eng/recordflux/RecordFlux#1461
The style check warnings for the license header have been fixed in fbecae0. |
Has any progress been made here? It's not just |
The fix is currently in progress. Unfortunately, it appears to be a difficult problem and it is not yet clear how long it will take to complete. As a workaround you could try to set the |
Thanks for the response! And glad to hear it is in progress :). I'll try your suggestion, I wasn't sure how to mix and match the two to be honest. The combinations I had tried so far weren't working as I expected. I'll try out your suggestion! The alternative which I think will work is to build my RecordFlux project as a separate library and link it. |
So adding |
Great to hear and thanks for reporting back! Adding that pragma to the generated code should be easy to do. I created an internal ticket for that. |
@dalybrown This is to let you know that |
Awesome - thanks! |
Hello,
This is more of a question than an issue. My build times are extremely long for anything besides a trivial RecordFlux specification. Often times, I run out of memory. I've tried removing parallel compilation to (presumably) consume less memory but it takes forever (hour++) for just a trivial (in my opinion) example.
The specification I'm trying to model has a general format for messages, and then I use type refinement based on some fields in the common part. After implementing the specification for one of the refinements, and just a placeholder for a second, the build times seem to increase exponentially. I should mention that there are many conditional fields and so the transition logic between each field has many guard conditions.
Is this expected? Should we be using a (extremely) beefy server to build anything that uses RecordFlux generated code? Are we using the wrong tool here? Maybe this is documented somewhere some of these limitations but I can't find them.
The text was updated successfully, but these errors were encountered: