Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Long Compilation time- OPC-UA
Long Compilation time- OPC-UA [message #1786035] Tue, 24 April 2018 13:29 Go to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 19
Registered: April 2017
Junior Member
Hello,
I am writing test suites for OPC-UA protocol and is taking approx 12 mins for compiling the whole project with all dependencies. Is there any way to decrease the compilation time? Any advice is highly appreciated.

My steps for compiling
1. compiler -Le *.ttcn
2. make

Thank You!

With Regards,
Avdoot Chalke
Re: Long Compilation time- OPC-UA [message #1786065 is a reply to message #1786035] Wed, 25 April 2018 06:23 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 807
Registered: January 2015
Senior Member
Hi Avdoot,

without having the code I can only make general remarks.


-first of all, your first call to the compiler is redundant; if you have correctly generated your Makefile,
then
make

should be sufficient.

What happens now is that
compiler -Le *.ttcn 


parses the code and generated the C++ files, then make will call again the compiler , which will reparse the same files again, but will not change the generated C++ files as the input was not changed.

Now this double reparsing will not have a significant effect on the compilation time, however it's redundant.

Please open your Makefile and check all your flags are there; most of the flags can be added when generating the Makefile with makefilegen options, but some need to be added manually.

OK, so let's see how we can improve compilation speed:

- when you call make, the TTCN-3 compiler and later the C++ compiler will work on one file at a a time, which means that in a multicore environment you are using only one core.

You should use make -jn -e.g. make -j 4 -instead, where n is the number of cores you want to involve in the compilation.

Check
time make 

versus e.g.
time make -j8 


to see the difference.

this works nicely as long as the compiler-generated C++ files are roughly of the same size; but it happens sometimes that one is larger than the others, constituting a bottleneck, so all will terminate quickly except this one.
In this case you may want to use the -U n flag of the compiler, which will then force it to generate not one C++ file (one .hh, .cc pair) but n ones ( one .hh and n .cc ones).

for instance
makefilegen -f -G -U 8 *.ttcn


will generate a Makefile with -e flag and generated C++ files split into 8


Also, I recommend you to use the gold linker

by adding the below flag in your Makefile:
# Flags for the linker:
LDFLAGS = -fuse-ld=gold


This will speed up linking -which may take up minutes- with no known drawback .


Also you can try to use clang-3.8 instead of gcc, but for this you need a Titan compiled with clang ( see https://www.eclipse.org/forums/index.php/m/1733511/) , so I'd leave this to the end.


If you attach the code, we can also take a look into your project and maybe suggest structural improvements or optimize the compiler.


Best regards
Elemer






[Updated on: Wed, 25 April 2018 06:47]

Report message to a moderator

Previous Topic:TTCN-3 Execution Error
Next Topic:Stateful translation ports
Goto Forum:
  


Current Time: Sat Sep 22 16:32:05 GMT 2018

Powered by FUDForum. Page generated in 0.01989 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top