Link time suddenly 5 times longer than before

HiTech had a great compiler for PSoC's M8C processor, but, then they were bought by Microchip. Subsequently the HiTech forums were taken off line. At the request of PSoCDeveloper members PSoCDeveloper has created this forum to allow HiTech users to support each other.

Moderator: ericb

Link time suddenly 5 times longer than before

Postby BitBangerB » Wed Oct 21, 2009 4:23 pm

Hello fellow Hi-Tech users. Is there anybody left??? This forum has been awfully quiet. Anway, I ran into a problem with Hi-Tech PRO version 9.61PL6 that is really eating my lunch. I added a small block of code and all of a sudden my build time (for a Rebuild All) went from under two minutes to nearly six. Most of that time is in the linking process and the program CGPSOC.EXE is the one that is running full steam (98% of CPU). At first, I just thought it was just out to la la land and it was never going to finish. On a whim today, I decided to start a build before going to lunch and was surprised when I came back to see that it had finished within 6 minutes. Previously, I just got impatient and killed the process after it went for about four.

Right now I just did a one-line code change. I commented out one of the function calls in the new code I added and hit F7. It took almost exactly one minute to build. I put the function call back in and the build took 5 minutes and 10 seconds. This might not be so terrible if I did a build once a day, but when I am hot and heavy into coding I find myself hitting F7 to do an incremental build 10 to 20 times a day. What once took 20 minutes from my day will now take nearly two hours! That will really impact my productivity.

I am hoping that somebody here knows why the addition of one stinking function call makes such a huge difference in link time. And, if there is a work-around for this, please share. In the mean time, I am going to search the old forums (thanks, Rolf) because I think this issue once came up there. Regards to all,

- B
User avatar
BitBangerB
Cheese Wheel
Cheese Wheel
 
Posts: 126
Joined: Wed Apr 11, 2007 4:03 pm
Location: Arizona

Re: Link time suddenly 5 times longer than before

Postby BitBangerB » Wed Oct 21, 2009 6:06 pm

I found the old forum post entitled "Slow linking - 5 minutes" posted by toybuilder on October 8th 2008. Clyde's first reply stated that "It's not actually the linker, it's the code generator spending all that time." I guess that must be true in my case as well (CGpsoc.exe), even though the build progess window says "linking...". Clyde's final post in the thread stated that this issue will not be resolved until they release version 9.70. We all know now that is never going to happen.

Since it is really the code generator getting bogged down, I had a little more hope of finding a work-around. First I tried turning all optimzations off... no luck. Then I thought, what if I turn the function call into inline assembly as follows:

foo(); // Original C-style call
asm("lcall _foo"); // work-around ASM call

Lo and behold it worked! Build time is now back to where it used to be. So it looks like I might have dodged that bullet, for now at least. I haven't actually tested the code yet however. If it does not work, I'll be back on this thread to tell all. I've been pretty lucky with Hi Tech tool chain up till now. I am now concerned that my luck may have just run out. What am I going to run into next?

- B
User avatar
BitBangerB
Cheese Wheel
Cheese Wheel
 
Posts: 126
Joined: Wed Apr 11, 2007 4:03 pm
Location: Arizona

Re: Link time suddenly 5 times longer than before

Postby toalan2001 » Wed Oct 21, 2009 7:13 pm

Those 5 minutes of compile time are brutal, long enough that you can not sit through it, short enough that you can get started on other work. Usually I play Street fighter or watch something on comedycentral; daily show, colbert report, southpark , usually the 5 min break turns into a half an hour of chillaxing, which is a total productivity killer. I used to grab a smoke when I compile, but I just quit.

What would be pretty cool is if cypress did something with the dead compile time, put up an ad, give me something to read, or put in some mini games.
toalan2001
The Big Cheese
The Big Cheese
 
Posts: 334
Joined: Thu May 24, 2007 7:01 am

Re: Link time suddenly 5 times longer than before

Postby BitBangerB » Thu Oct 22, 2009 10:45 am

toalan,

You spoke my mind. Too long to do nothing, not enough time to switch to another project for a while. Add the build time to the time it takes to download to the emulator, and you get several minutes of unproductive boredom (and in some cases, anxiety). What is worse, you really cannot use your computer for anything else, especially when downloading to the emulator. I am wondering if a multi-core processor would at least alleviate that problem. I could at least take in a news article or something off of the internet, but my computer is so bogged down I am essentially paralyzed. Let me know if your new multi-core system has helped in that regard. Thanks,

- B
User avatar
BitBangerB
Cheese Wheel
Cheese Wheel
 
Posts: 126
Joined: Wed Apr 11, 2007 4:03 pm
Location: Arizona

Re: Link time suddenly 5 times longer than before

Postby BitBangerB » Thu Oct 22, 2009 10:47 am

One more thing toalan,

You and I like the same cable TV shows.

- B
User avatar
BitBangerB
Cheese Wheel
Cheese Wheel
 
Posts: 126
Joined: Wed Apr 11, 2007 4:03 pm
Location: Arizona

Re: Link time suddenly 5 times longer than before

Postby toalan2001 » Thu Oct 22, 2009 3:39 pm

I run a dual core and I can do stuff while the program is compiling, however even doing the simplest things seem to dramatically increase the compile time. Maybe it would be much better with a quad core CPU.

Might be a good idea to invest in a netbook so that you can surf the net and answer emails while the computer is compiling.

Also, why does Jon and Stephen keep taking breaks every 2 months, and why do they take breaks at the same time. There has been absolutely nothing to watch for the past week.
toalan2001
The Big Cheese
The Big Cheese
 
Posts: 334
Joined: Thu May 24, 2007 7:01 am

Re: Link time suddenly 5 times longer than before

Postby BitBangerB » Thu Oct 22, 2009 5:56 pm

Good idea... why go two cores when you can just go with two computers! Though it is rather large, there is an old Toshiba laptop just gathering dust here that I might use for surfing while I wait on my builds.

As for Jon and Stephen, maybe they like to pal around together. I do think it would be better if they would not take vacations at the same time so we always have something fresh. They have missed out on a lot of good stuff to make fun of while they both were on vacation. Oh well...

- B
User avatar
BitBangerB
Cheese Wheel
Cheese Wheel
 
Posts: 126
Joined: Wed Apr 11, 2007 4:03 pm
Location: Arizona


Return to “%s” HiTech C User-to-User Support

Who is online

Users browsing this forum: No registered users and 1 guest