Thursday, September 30, 2010

Testing j-value with a big package

I guess Chris Tyler is not convinced about j1 is faster than j3 or j2. There are two such cases, include my own, were posted on the Planet. I decide to test a big package. I chose gcc-c++. The size of the rpm source package is about 50M. It seems not that big. So the other day I tried to run rpmbuild on this package. It run more than 2 hours and didn't finish. I had to kill it.

I decide to write a small script to run automatically. First I use a simple for loop (for i in 1 2 3 4 5). But how to catch the time. If I use time before rpmbuild, I need to redirect the output to catch the time. The redirection file will be huge. But I only need the last 3 lines. The funny thing is that 3 lines of time is not redirected (when I test using a small package). So I better use time stamp, recording time before build (date +%s) and recording time after. Then out put the difference.

To change the j value in .rpmmacro file, I couldn't think of a better solution. OPS435 was quite some time ago. I simply just echo the 3 lines to the file before run the rpmbuild command. I think it's not a good approach in scripting. But I want to start run the test sooner. After I tested the script, I started to run the build this evening and planed to run over night. I set to run 5 cases (from 1 to 5). I don't know if it will finish by tomorrow morning. I will add the result here as soon as the test is done.

......The test result finally comes out.  The output is like this:

This is testing of j1.
Time spent is:  37835 seconds
This is testing of j2.
Time spent is:  38562 seconds
This is testing of j3.
Time spent is:  39019 seconds
This is testing of j4.
Time spent is:  39316 seconds
This is testing of j5.
Time spent is:  39301 seconds

It seems j1 is still faster. I wonder what could be an explaination for that.

1 comment:

  1. Hey, in your loop script, just pipe the output to the tail command and only capture the last few lines and append it to an output file.
    I have something similar running for my SNORT rpmbuild. Let me know if you want me to upload the script.

    Regards,
    Andrew

    ReplyDelete