Compiler slow to start

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Compiler slow to start

1,398件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdebliek on Thu Jul 03 13:34:51 MST 2014
I have previously used a purchased version of Code Red Suite, but recently have switched to LPCxpresso to get the latest device support.  My Code Red suite always compiled quite fast, but I find LPCxpresso seems to stall for a while at the start of a compile.  It will display "make all" in the console, then there will be a long pause before the compiled files info starts scrolling through.  I am working on a fairly large project, and I have seen a pause of over 90 seconds at times.  I am building from a network drive, but this did not seem to be a problem with Red Suite.  Is this normal in LPCxpresso?  Is there some way to speed up the compiler?
0 件の賞賛
返信
5 返答(返信)

1,378件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OldManVimes on Sat Jul 12 03:11:24 MST 2014
Hi,

You can get even more speed gains.

Open the project properties in Eclipse/LPCXpresso and go to "C/C++ Build". Select the "Builder settings" tab on that screen and change the "Build command" to "make -r -s -j${NUMBER_OF_PROCESSORS} -k".
If you use Linux, then remove/replace the "-j${NUMBER_OF_PROCESSORS}" by something that works on that platform. On Windows ${NUMBER_OF_PROCESSORS} expands to the number of cores in your CPU. You can also hard code this to something like "-j4" if you have 4 cores.

Let's break this down:
-r tells make not to evaluate it's many built-in rules. There is no need for make to use these since Eclipse generates makefiles that contain all dependency details. The built-in rules take a 'long' time to evaluate.
-s tells make to be silent. This one is optional and it has no impact on speed
-j<number> tells make to parallelize the build. This one makes a huge difference it you haven't activated parallel build yet. Hacking the makefiles gets more tricky though, so be aware of that.
-k tells make to keep going in case it encounters an error. Again, this is optional and has no effect on the compilation speed.

This works in a generic Eclipse environment as well. I can't figure out why the -r flag is not added automagically by Eclipse since it shaves off precious time and is not needed due to the way Eclipse generates GNU makefiles.

Happy compiling
0 件の賞賛
返信

1,378件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdebliek on Mon Jul 07 13:13:07 MST 2014
Copying make.exe from Red Suite seems to speed things up substantially as well.  Thanks!
0 件の賞賛
返信

1,378件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Jul 04 09:03:34 MST 2014
One other thought:

We upgraded the version of make shipped with the product (from 3.79 to 3.81)*. Try copying the make.exe from the RS install into the LPCXpresso install (it is in msys\bin) and see if that makes a difference.

(*) this was done as 3.79 was release in 2000, whereas 3.81 was released in 2006 (!) and adds some additional features that some customers were asking for. As far as LPCXpresso is concerned, it does not use these new features so it is safe for you to copy.
0 件の賞賛
返信

1,378件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdebliek on Fri Jul 04 08:22:06 MST 2014
Thank you for your response.  I did a test using a copy of a project I have been using in Red Suite.  The project is on the network drive.  I first opened it in Red Suite (version 4.0.4), did a project clean then build.  Then I opened the same project in LPCxpresso (version 6.1.0), did a clean then build.  Here are the results:

Red Suite - no noticeable pauses, total build time about 10 sec

LPCxpresso - 9 sec pause before CMSIS compile starts, 23 sec pause before project compile starts, total build time 1 min 22 sec

I then changed to the internal build option for both CMSIS and the project in LPCxpresso, the total build time dropped to 8 sec

I checked Red Suite, and it is using the external build option, but for some reason LPCxpresso does not work well with the external build.  I have seen the same issue with every project I have tried in LPCxpresso so far, and my co-worker has also had similar results.
0 件の賞賛
返信

1,378件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Jul 04 02:14:43 MST 2014
So, this has nothing to do with the compiler. It is make doing its dependency processing (working out what has changed, and thus, what to build).

To do its dependency processing, make has to open all the dependency files (*.d) and then compare modification times to work out what has changed. In a large project that is a LOT of file accesses. If you are doing this on a network drive, that is going to result in a lot of network traffic. Note that each of these accesses is for a very small amount of data, meaning that there is no opportunity for the network to optimize for large transfers (which is what most networks and remote filesystem try to do), or to cache the data.

Having said that, it should not have been any different for Red Suite - we use the same make.

I suggest that you compare Red Suite and LPCXpresso with *identical* projects. I think you will find very little difference in time.

One other thing you could try (and I doubt that it will make any difference, but may) is to use the "internal builder" instead of make. To do this, open your project Properties and on the "C/C++ Setting", switch the Builder Type to "Internal".

Finally, I would strongly recommend for a large project (you don't mention how large...) that you don't try to build on a network drive - do it on a local drive and you should see a very significant performance improvement.
0 件の賞賛
返信