Tuesday, November 10, 2009

Testing g++ and modified g++

So we had the task in class of testing build times on a package using regular g++ and a modified g++. To do this we had to get the new modified version which I accomplished using this script here. After running this script you will have a new directory called "tools" in your home directory which has the new version of g++ in it.

First thing you should do before anything is test building a package that has a lot of c that needs to be compiled. I used abiword for this. I used the command

time rpmbuild -ba abiword.spec

to get the build times for this.

So to be able to use the modified g++ I had to change the the original /usr/bin/g++ to my new one. But we do not want to lose the old one so I just renamed the old one g++.original. I also did this for the c++ in /usr/bin.

Next I created a symbolic link using the command

su -c "ln -s /home/ashilts/tools/gcc-dehydra/installed/bin/[gc]++ /usr/bin"

and this command created a symbolic link name g++ and also one for c++ in the /usr/bin directory.

Next tried to do the building and it worked mostly until i got to the install section where it failed because it said there was something wrong with the rpaths. I asked my teacher Chris Tyler about this and he gave me the advice of using the command

time QA_RPATHS=$[ 0x003f ] rpmbuild -ba abiword.spec

to run the build process which worked perfectly. I am not very sure what rpaths are even after reading a wiki page on them, but I will link it for anybody that wants to get a little more insight on them.

RPATHS

So The final tests of mine showed that the regular g++ was a slight bit slower by around about 10 seconds at the most. Here is a chart with the stats

Test # Regular g++

Modified g++

1

real 6m42.508s

user 10m36.408s

sys 3m15.561s

real 4m20.988s

user 3m18.736s

sys 2m37.991s

2

real 3m43.744s

user 3m15.126s

sys 2m27.259s

real 4m18.335s

user 3m17.841s

sys 2m36.843s

3

real 3m44.547s

user 3m14.892s

sys 2m27.509s

real 3m51.537s

user 3m18.214s

sys 2m37.537s

4

real 3m41.988s

user 3m14.702s

sys 2m27.030s

real 4m15.478s

user 3m17.870s

sys 2m31.028s

Hmmm I was having troubles getting this table presentable but I think you should be able to make it out.

So in conclusion I think that the modified g++ had a decent build time but I dont know if it will be good enough to use when use to compile things that are much bigger and have longer build time.

I think that is all for now so cya!

No comments:

Post a Comment