Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting compilation time of installed packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
linux_dream
n00b
n00b


Joined: 18 Jun 2015
Posts: 12

PostPosted: Mon Jul 13, 2015 6:54 pm    Post subject: Getting compilation time of installed packages Reply with quote

Hi guys,
I've created (with the help of some guys in IRC) a little script that produces some easy to analyze data about the time it took you to compile all your currently installed packages.
Code:
#!/bin/bash
qlist -I > input-packages-list.txt
while IFS= read -r p; do
qlop -tH "$p" >> output.txt
done <input-packages-list.txt
sed 's/.*://; s/[^ 0-9]*//g' output.txt > output2.txt
#sed 's/[^ 0-9]*//g' output2.txt > output3.txt
#Now using gawk
#if numbers of elements is 4 then multiply the 1st by 3600, multiply the 2nd by 60 and add the 3 first numbers; consider the result as the new 1st element
# while if the number of elements is 3 then multiply the 1st by 60 and add it to the 2nd element; consider the result as the new 1st element
#so that in the end I'm left with 2 columns: time in seconds and number of compilation(s)
awk '
NF == 3 {
$1 = $1 * 60 + $2
print $1,$3;
}
NF == 4 {
$1 = $1 * 3600 + $2 * 60 + $3
print $1,$4;
}
NF != 3 && NF != 4 {
print $1,$2
}
' output2.txt > output3.txt
rm output.txt
rm output2.txt

Feel free to modify the code and make it better (for instance I create output.txt and output2.txt which I am sure is unnecessary.)
To run the code, save the code in a file.sh, then type
Code:
chmod +x file.sh
and execute it with
Code:
# sh file.sh
.
I made a histogram (with R programming language) out of my stats: https://laundryisrandom.files.wordpress.com/2015/07/gentoo-data.png

So far I've compiled every package about 1.31 times in average. And about the time taken (in seconds):
Code:
Min.  1st Qu.  Median    Mean     3rd Qu.     Max.
4.0    10.0       20.0    116.9   45.0     20580.0

So slightly less than 2 minutes in average to compile a package on my system although the median is 20 seconds, thus around half of the packages took less than 20 seconds to compile and about half took more than 20 seconds. I've got 608 packages that I've compiled and that are currently installed.
Feel free to share your numbers.

P.S.:My hardware is Intel Core i3-3217U CPU @ 1.80GHz, but I use only 2 threads for compilation and I've 4 GB of RAM.
Enjoy :)
Back to top
View user's profile Send private message
CaptainBlood
Guru
Guru


Joined: 24 Jan 2010
Posts: 518

PostPosted: Mon Jul 13, 2015 8:02 pm    Post subject: Reply with quote

Hi,
As a side note there is "genlop" package that retrieves compile time data too, at package level.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum