PICmicro & dsPIC >> PICmicro & dsPIC

Pages: 1 | 2 | 3 | >> (show all)
BasePointer
Tester - PICC PRO
*

Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
Tricks to reduce compile time?
      #16110 - Sun Mar 06 2005 05:45 AM

Hello,

What are the tricks to reduce compile time of PICC18? Compile time of my current application is 15 seconds and it grows as proportional to the size of the application.

Thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
Ryan
HI-TECH team member
*****

Reged: Jan 06 2004
Posts: 503
Loc: Brisbane, Australia
Re: Tricks to reduce compile time? [Re: BasePointer]
      #16114 - Sun Mar 06 2005 05:39 PM

The compiler will have a delay when building until it is activated; this is the same for the demo. If you have a large project it can take a while, but nothing out of the ordinary. Perhaps you're encountering the delay?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Dimitri Turbiner



Reged: Dec 02 2004
Posts: 8
Re: Tricks to reduce compile time? [Re: Ryan]
      #16123 - Sun Mar 06 2005 08:51 PM

I use a fully working picc18 compiler. Everything goes OK for normal code but when I compile some heavy math, even with all optimizations off it takes about a minute to compile!.

For example
Code:
 
teta2 = gamma + acos(
        (pow(x4,2)+pow(y4,2)+pow(z4,2)-pow(l3,2)+pow(l2,2))/
        (2*l2*sqrt(pow(x4,2)+pow(y4,2)+pow(z4,2))));



    teta3 = PI / 2 - acos(
        (pow(x4,2)+pow(y4,2)+pow(z4,2)-pow(l3,2)+pow(l2,2))/
        (2*l2*sqrt(pow(x4,2)+pow(y4,2)+pow(z4,2)))) - acos(
        (pow(x4,2)+pow(y4,2)+pow(z4,2)+pow(l3,2)-pow(l2,2))/
        (2*l3*sqrt(pow(x4,2)+pow(y4,2)+pow(z4,2))));

 



I'm just posting to post, no questions or anything.
The compiler is great, congratulations.
Dimitri


Post Extras: Print Post   Remind Me!   Notify Moderator  
BasePointer
Tester - PICC PRO
*

Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
Re: Tricks to reduce compile time? [Re: Ryan]
      #16137 - Sun Mar 06 2005 11:49 PM

Hello Ryan,

I have already activated it. I have a huge project to compile. I'm using a lot of unit in the project like io.c, bl.c, rtc.c, serial.c, etc... Doesn't PICC18 every times compile all units that I use when I build the project. Isn't there a way my units to become pre-compiled. I may reduce compile time with this way?

Thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan HenryModerator
Guru
****

Reged: Oct 16 2003
Posts: 3863
Loc: Colorado
Re: Tricks to reduce compile time? [Re: BasePointer]
      #16139 - Sun Mar 06 2005 11:58 PM

Quote:

Isn't there a way my units to become pre-compiled.



Sounds like a job for a 'make' tool.


Post Extras: Print Post   Remind Me!   Notify Moderator  
BasePointer
Tester - PICC PRO
*

Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
Re: Tricks to reduce compile time? [Re: Dimitri Turbiner]
      #16140 - Sun Mar 06 2005 11:59 PM

Hello Dimitri,

If you use huge table like below, It takes extra about 10 seconds.

Code:
static const char* const str[] = {"menu", "back", "prepare", "run",...};



Post Extras: Print Post   Remind Me!   Notify Moderator  
kcress



Reged: Feb 22 2005
Posts: 42
Re: Tricks to reduce compile time? [Re: BasePointer]
      #16148 - Mon Mar 07 2005 04:01 AM

Hi Base,

There are two button in the IDE for compiling.
One does them all. The other only does what
needs to be compiled usually just the module
you just worked on.. Which is about 50% faster
if you have 6-8 modules.


Post Extras: Print Post   Remind Me!   Notify Moderator  
luckyAdministrator
Microchip staff
*****

Reged: Oct 06 2003
Posts: 1184
Loc: Brisbane, Australia
Re: Tricks to reduce compile time? [Re: Dimitri Turbiner]
      #16150 - Mon Mar 07 2005 06:46 AM

Someone recently asked this question, to which Clyde responded:
Quote:

Code generation represents an NP-complete problem. We use various heuristics to limit the search space for solutions, otherwise everything would take a long time to compile. Occasionally a particular expression comes along that the heuristics don't work well on, so the code generator ends up considering nearly every possible solution before finding one that's suitable. With an example, we can tweak the heuristics to deal with this particular case by guiding the search down a path that terminates early.




However, I'm not surprised that your example does take a little while to process Dimitri. I would say that the example is a little unusual (but perfectly valid). Turning global optimizations on will further increase the time, as the code generator will (re)considered register usage. Like Clyde says, most of time it's pretty quick, but sometimes you guys write stuff that really gives it a workout. If it's annoying, a quick work-around would be to simplify the expression (break it up into multiple lines), or, you can send the example to support@htsoft.com so that someone can take a look at it when the next version of the compiler is released.

--------------------
Matt Luckman
Microchip Technology Inc.


Post Extras: Print Post   Remind Me!   Notify Moderator  
pball

***

Reged: Apr 19 2004
Posts: 51
Re: Tricks to reduce compile time? [Re: BasePointer]
      #16158 - Mon Mar 07 2005 10:26 AM

Where's the problem with 15 seconds? Honestly, that is really peanuts.

Most of the time I have to work on an application using Visual Studio C++ and the compile time for the project is 15 minutes! A number of years ago I had to work with an Ada compiler and the whole project took three hours to compile.

--------------------
There are 10 kinds of people, those that can do binary arithmetic and those that can't.


Post Extras: Print Post   Remind Me!   Notify Moderator  
BasePointer
Tester - PICC PRO
*

Reged: Oct 16 2003
Posts: 203
Loc: Istanbul, Turkey
Re: Tricks to reduce compile time? [Re: Dan Henry]
      #16165 - Mon Mar 07 2005 11:49 AM

Quote:

Sounds like a job for a 'make' tool.




What is 'make' tool ?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | 3 | >> (show all)



Extra information
2 registered and 29 anonymous users are browsing this forum.

Moderator:  mikerj, jtemples, jeff, Dan Henry, Andrew L 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 8470

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5