forked from menault/TD1_DEV51_Qualite_Algo
fin tp1
This commit is contained in:
137
compte_rendu.txt
137
compte_rendu.txt
@@ -1,8 +1,145 @@
|
||||
gcc -g -pg -o student_rank student_rank.c heapsort.c bubblesort.c
|
||||
|
||||
gprof ./student_rank
|
||||
|
||||
il y a plussieur information qu'on peut retrouver comme :
|
||||
|
||||
le temps de répartition entre les differentes fonctions,
|
||||
le temps d'd'éxecution cumulé au fur et à mesure (dans l'ordre d'utilisation des fonction) ,
|
||||
le temps pris par chacune des fonctions,
|
||||
le nombre de fois que la fonction a était appeller,
|
||||
le nombre de temps pris par appel en milliseconde,
|
||||
le nombre total pris pour avoir éxécuter tout les appel de la fonction et aussi celle que lui appel (ses enfants).
|
||||
enfin le nom de la fonction en question.
|
||||
|
||||
Flat Profile :
|
||||
Temps et nombre d'éxecution de chaque fonction.
|
||||
|
||||
ex:
|
||||
|
||||
Flat Profile
|
||||
|
||||
Each sample counts as 0.01 seconds.
|
||||
% cumulative self self total
|
||||
time seconds seconds calls s/call s/call name
|
||||
79.80 2.35 2.35 1001000 0.00 0.00 bubblesort
|
||||
19.35 2.92 0.57 1000000 0.00 0.00 find_rank_student
|
||||
0.34 2.93 0.01 1000 0.00 0.00 generate_array
|
||||
0.34 2.94 0.01 1 0.01 0.01 generate_ranks
|
||||
0.34 2.96 0.01 1 0.01 2.93 sort_students
|
||||
0.00 2.96 0.00 2 0.00 0.00 free_array
|
||||
0.00 2.96 0.00 1 0.00 0.01 generate_grades
|
||||
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Call Graph :
|
||||
Voir arbre d'appel + temps et nb d'exec par fonction
|
||||
|
||||
ex : Call graph (explanation follows)
|
||||
|
||||
|
||||
granularity: each sample hit covers 2 byte(s) for 0.34% of 2.96 seconds
|
||||
|
||||
index % time self children called name
|
||||
<spontaneous>
|
||||
[1] 100.0 0.00 2.96 main [1]
|
||||
0.01 2.92 1/1 sort_students [2]
|
||||
0.00 0.01 1/1 generate_grades [6]
|
||||
0.01 0.00 1/1 generate_ranks [7]
|
||||
0.00 0.00 2/2 free_array [8]
|
||||
-----------------------------------------------
|
||||
0.01 2.92 1/1 main [1]
|
||||
[2] 99.3 0.01 2.92 1 sort_students [2]
|
||||
0.57 2.35 1000000/1000000 find_rank_student [3]
|
||||
0.00 0.00 1000/1001000 bubblesort [4]
|
||||
-----------------------------------------------
|
||||
0.57 2.35 1000000/1000000 sort_students [2]
|
||||
[3] 98.9 0.57 2.35 1000000 find_rank_student [3]
|
||||
2.35 0.00 1000000/1001000 bubblesort [4]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 1000/1001000 sort_students [2]
|
||||
2.35 0.00 1000000/1001000 find_rank_student [3]
|
||||
[4] 79.7 2.35 0.00 1001000 bubblesort [4]
|
||||
-----------------------------------------------
|
||||
0.01 0.00 1000/1000 generate_grades [6]
|
||||
[5] 0.3 0.01 0.00 1000 generate_array [5]
|
||||
-----------------------------------------------
|
||||
0.00 0.01 1/1 main [1]
|
||||
[6] 0.3 0.00 0.01 1 generate_grades [6]
|
||||
0.01 0.00 1000/1000 generate_array [5]
|
||||
-----------------------------------------------
|
||||
0.01 0.00 1/1 main [1]
|
||||
[7] 0.3 0.01 0.00 1 generate_ranks [7]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 2/2 main [1]
|
||||
[8] 0.0 0.00 0.00 2 free_array [8]
|
||||
-----------------------------------------------
|
||||
|
||||
Fonction la plus lente : bubblesort
|
||||
nombre d'appel important de bubblesort dans find_rank_student
|
||||
|
||||
|
||||
après avoir changer les fonction bublesort par heapsort on a :
|
||||
|
||||
Flat profile:
|
||||
|
||||
Each sample counts as 0.01 seconds.
|
||||
% cumulative self self total
|
||||
time seconds seconds calls ms/call ms/call name
|
||||
100.17 0.04 0.04 1000000 0.00 0.00 find_rank_student
|
||||
0.00 0.04 0.00 1500000 0.00 0.00 sift
|
||||
0.00 0.04 0.00 1000 0.00 0.00 generate_array
|
||||
0.00 0.04 0.00 1000 0.00 0.00 heapsort
|
||||
0.00 0.04 0.00 2 0.00 0.00 free_array
|
||||
0.00 0.04 0.00 1 0.00 0.00 generate_grades
|
||||
0.00 0.04 0.00 1 0.00 0.00 generate_ranks
|
||||
0.00 0.04 0.00 1 0.00 40.07 sort_students
|
||||
|
||||
|
||||
--------------------------------------------------
|
||||
|
||||
Call graph
|
||||
|
||||
|
||||
granularity: each sample hit covers 2 byte(s) for 24.96% of 0.04 seconds
|
||||
|
||||
index % time self children called name
|
||||
0.04 0.00 1000000/1000000 sort_students [2]
|
||||
[1] 100.0 0.04 0.00 1000000 find_rank_student [1]
|
||||
-----------------------------------------------
|
||||
0.00 0.04 1/1 main [3]
|
||||
[2] 100.0 0.00 0.04 1 sort_students [2]
|
||||
0.04 0.00 1000000/1000000 find_rank_student [1]
|
||||
0.00 0.00 1000/1000 heapsort [6]
|
||||
-----------------------------------------------
|
||||
<spontaneous>
|
||||
[3] 100.0 0.00 0.04 main [3]
|
||||
0.00 0.04 1/1 sort_students [2]
|
||||
0.00 0.00 2/2 free_array [7]
|
||||
0.00 0.00 1/1 generate_grades [8]
|
||||
0.00 0.00 1/1 generate_ranks [9]
|
||||
-----------------------------------------------
|
||||
384971 sift [4]
|
||||
0.00 0.00 1500000/1500000 heapsort [6]
|
||||
[4] 0.0 0.00 0.00 1500000+384971 sift [4]
|
||||
384971 sift [4]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 1000/1000 generate_grades [8]
|
||||
[5] 0.0 0.00 0.00 1000 generate_array [5]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 1000/1000 sort_students [2]
|
||||
[6] 0.0 0.00 0.00 1000 heapsort [6]
|
||||
0.00 0.00 1500000/1500000 sift [4]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 2/2 main [3]
|
||||
[7] 0.0 0.00 0.00 2 free_array [7]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 1/1 main [3]
|
||||
[8] 0.0 0.00 0.00 1 generate_grades [8]
|
||||
0.00 0.00 1000/1000 generate_array [5]
|
||||
-----------------------------------------------
|
||||
0.00 0.00 1/1 main [3]
|
||||
[9] 0.0 0.00 0.00 1 generate_ranks [9]
|
||||
-----------------------------------------------
|
Reference in New Issue
Block a user