Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (72)
Showing
with 3629 additions and 30 deletions
## Etendue de l'étude
- Nombre de tris
- [x] Insertion, Fusion, Rapide et au moins un autre tri sont traités.
- [ ] Insertion, Fusion et Rapide sont traités.
- [ ] Insertion, Fusion et Rapide ne sont pas tous traités.
- Type de jeu de test
- [ ] Aléatoire, Trié, Tri inversé et au moins un autre jeu sont traités.
- [x] Aléatoire, Trié et Tri inversé sont traités.
- [ ] Aléatoire, Trié et Tri inversé ne sont pas tous traités.
## Rédaction et analyses
- Description du problème
- [x] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Application
- [x] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Environnement de test
- [x] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Description de la démarche systématique
- [ ] La section est pertinente, succincte et précise.
- [x] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Analyse des résultats préalables
- [x] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Discussion des résultats préalables
- [ ] La section est pertinente, succincte et précise.
- [x] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Hypothèse
- [ ] La section est pertinente, succincte et précise.
- [x] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Protocole expérimental de vérification de l'hypothèse
- [x] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [ ] La section n'est pas pertinente.
- Analyse des résultats expérimentaux
- [ ] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [x] La section n'est pas pertinente.
- Discussion des résultats expérimentaux
- [ ] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [x] La section n'est pas pertinente.
- Conclusion et travaux futurs
- [ ] La section est pertinente, succincte et précise.
- [ ] La section est pertinente.
- [x] La section n'est pas pertinente.
## Résultats
- Nombre
- [x] Les tests sont suffisament nombreux pour observer des épiphénomènes
- [ ] Les tests sont suffisament nombreux pour observer des phénomènes
- [ ] Les tests ne sont pas suffisament nombreux pour observer des phénomènes
- Echantillon
- [x] L'échantillon choisi a un bon équilbre entre temps d'exécution et observations
- [ ] L'échantillon choisi néglige les temps d'exécution
- [ ] L'échantillon choisi néglige les observations
- Artefacts
- [ ] Les observations excluent tout artefacts
- [x] Certains artefacts, comme des pas d'horloge, sont visibles
- [ ] Seuls des artefacts sont observables
- Décoration
- [x] Les plots contiennent légende et titre
- [ ] Les plots contiennent légende ou titre
- [ ] Les plots ne contiennent ni légende ni titre
- Lisibilité
- [x] Les plots permettent de lire clairement toutes les séries
- [ ] Les plots permettent de lire clairement la plupart des séries
- [ ] Les plots permettent pas de lire clairement la plupart des séries
- Echelles
- [x] Les échelles sont respectées pour permettre la visualisation et la comparaison des séries entre plots
- [ ] Les échelles sont respectées pour permettre la visualisation des séries entre plots
- [ ] Les échelles ne sont pas respectées pour permettre la visualisation des séries entre plots
## Hypothèse
- Originalité
- [ ] L'hypothèse émise est orginale et trouvée intégralement par l'étudiant.
- [x] L'hypthèse émise est orginale.
- [ ] L'hypthèse émise n'est pas originale.
- Difficulté
- [ ] L'hypothèse émise est très difficile à prouver.
- [x] L'hypothèse émise est difficile à prouver.
- [ ] L'hypothèse émise est facile à prouver.
- Théorie
- [ ] L'analyse de l'hypothèse se confronte à la théorie avec pertinence.
- [ ] L'analyse de l'hypothèse se confronte à la théorie.
- [x] L'analyse de l'hypothèse ne se confronte pas à la théorie.
# Résultat
- Total d'item « Excellent » (1 point) : 11
- Total d'item « Satisfaisant » (0,5 point: 7
- Total d'item « Insatisfaisant » (0 point) : 4
- Note sur 22 : 14,5
# P4z : Analyse de performances de différents tris
[Grille d'évaluation P4z](https://docs.google.com/spreadsheets/d/1VXeO91rhy04xa0p8KUhWliFl228utHaDir8MstO5Z-M/edit?usp=sharing
)
[Grille d'évaluation P4z](https://docs.google.com/spreadsheets/d/1VXeO91rhy04xa0p8KUhWliFl228utHaDir8MstO5Z-M/edit?usp=sharing)
## Problème
Description du Problème.
Notre problème ? Comment trier efficacement des tableaux !
Description de tous les paramètres exploratoires du problème
Et par efficacement trier des tableaux, nous entendons les trier le plus rapidement
possible, en consommant le moins de mémoire possible. Pour ceci nous allons partir
de 4 algorithmes de tri différents et étudier leur temps d'exécution et leur consommation
de mémoire en fonction du tableau à trier (tableau généré aléatoirement, déjà trié,
trié dans le sens inverse).
## Dispositif expérimental
### Application
[code source de l'application](chemin)
```
Description de l'application et des arguments
```
[code source de l'application](src/)
Pour utiliser les tris, vous avez besoin de 2 choses:<br>
- Le binaire `tri`<br>
- Un document texte contenant les éléments du tableau, chaque élément est séparé du prochain par un espace et pour finit par un `.`. <br>
Ex : `4 3 11 29 .`<br>
Le binaire demande une option et un fichier, le fichier est du type de ceux définit plus haut, quant aux option il en existe plusieures : <br>
- `-i` ou `--insertion` pour le tri à insertion
- `-f` ou `--fusion` pour le tri à fusion
- `-r` ou `--rapide` pour le tri rapide
- `-b` ou `--bulle` pour le tri à bulle
- `-a` ou `--all` pour tout les tris disponibles
- `-iv` ou `--insertion-verbose` pour le tri à insertion avec les affichages avancés
- `-fv` ou `--fusion-verbose` pour le tri à fusion avec les affichages avancés
- `-rv` ou `--rapide-verbose` pour le tri rapide avec les affichages avancés
- `-g` qui génére un nouveau tableau sur stdout avec une taille du tableau et un nombre max
- `-gt` qui génére un nouveau tableau trié sur stdout avec une taille du tableau et un nombre max
- `-gti` qui génére un nouveau tableau trié dans le sens inverse sur stdout avec une taille du tableau et un nombre max
### Environnement de test
Description de la plateforme de test
Les tests se sont fait sur troglo en connexion à distance, le fichier obtenu avec cat /proc/cpuinfo est disponible ici : [cpuinfo](src/Scripts/cpuinfo.txt).
D'autres test (principalement pour les hypothèses) ont été effectués sur l'ordinateur personnel d'Antonin, (ce qui a déjà entrainé quelques soucis), le cpuinfo de l'ordinateur est disponible ici : [cpuinfo_antonin](src/Scripts/cpuinfo_antonin.txt).
Les infos "importantes" :
- Sur Troglo
```
model name : Intel(R) Xeon(R) CPU E5-2630L v3 @ 1.80GHz
cpu MHz : 1198.728
cache size : 20480 KB
```
Extrait pertinent de /proc/cpuinfo
- Sur l'ordinateur d'Antonin
```
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1407.683
cache size : 12288 KB
```
### Description de la démarche systématique
Description de la démarche systématique et de l'espace d'exploration pour chaque paramètres.
Pour obtenir perf.dat contenant toutes les données (à exécuter dans [src/Scripts/](src/Scripts/)):
```
Suite des commandes, ou script, à exécuter pour produire les données.
./perf.sh > perf.dat
```
Ensuite, il faut lancer R et exécuter les commandes du fichier [src/R/perf.R](src/R/perf.R) :
```
R
library(ggplot2)
perf <- read.table("perf.dat", header = TRUE)
ggplot(perf, aes(x=taille, y=temps, group=tri, colour=tri)) + geom_point() + geom_smooth() + facet_grid(tri~sort) + ggtitle("Graphe des temps d'exécution")
ggsave("../Images/graphe_temps.png")
ggplot(perf, aes(x=taille, y=mem, group=tri, colour=tri)) + geom_point() + geom_smooth() + facet_grid(tri~sort) + ggtitle("Graphe des consommations mémoire")
ggsave("../Images/graphe_memoire.png")
```
## Résultats préalables
### Temps d'exécution
| Jeu de test | Tri par Insertion | Tri Fusion | Tri Rapide |
|----------------------|---------------------------|---------------------------|---------------------------|
| Aléatoire | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) |
| Trié | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) |
| Tri inversé | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) |
<img src="src/Images/graphe_temps.png" width="500"/>
### Consommation mémoire
| Jeu de test | Tri par Insertion | Tri Fusion | Tri Rapide |
|----------------------|---------------------------|---------------------------|---------------------------|
| Aléatoire | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) |
| Trié | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) |
| Tri inversé | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) | ![plot](path/to/plot.png) |
<img src="src/Images/graphe_memoire.png" width="500"/>
### Analyse des résultats préalables
Explications précises et succinctes des résultats préalables.
Grâce à ces deux graphes, nous pouvons constater qu'il y a principalement 3 types de tri :
- Les tris qui s'exécutent rapidement mais consomment beaucoup de mémoire,
comme le tri fusion qui consommera toujours beaucoup de mémoire, que le tableau
soit de base trié, trié dans le sens inverse ou aléatoire.
- Les tris qui consomment peu de mémoire mais s'exécutent plus lentement,
comme le tri par insertion qui n'a aucun problème avec un tableau déjà trié,
mais met plus de temps avec un tableau trié dans le sens inverse. Le tri à bulle
lui, est aussi plus rapide avec un tableau trié mais reste lent.
- Les tris qui s'exécutent rapidement et consomment peu de mémoire, plus rare,
comme le tri rapide qui cependant a beaucoup de mal avec un tableau déjà trié,
voir trié dans le sens inverse.
### Discussion des résultats préalables
Explications pcises et succinctes des limites des résultats
préalables et ce qu'ils ne permettent pas de vérifier.
Certains résulats ne permettent pas de déduire que, par exemple, le tri par insertion est plus rapide sur des tableaux à moitié rangé.
Le tri rapide s'il sélectionne comme pivot le premier éléments (ou le dernier) va se retrouver bloqué ou extrêmement lent, ces cas sont particuliers et on ne peux donc pas les déterminé simplement à la simple vue des graphiques.
## Etude approfondie
### Hypothèse
Expression précise et succincte d'une hypothèse.
Le tri par insertion devient de plus en plus long quand la taille du tableau augmente, et donc celui-ci ne sait traiter efficacement uniquement des petits tableaux, étant donnée que tout les autres algorithmes coupent leurs tableaux en de plus petit tableaux. Notre hypothèse est, que si le tri par insertion est donc plus performant que les autres tris sur des petit tableaux, alors nous allons l'utiliser dans les autres tris, par exemple dans le tri rapide.
### Protocole expérimental de vérification de l'hypothèse
Expression précise et succincte du protocole.
Pour se faire nous allons donc voir si effectivement le tri par insertion se déroule plus rapidement sur plein de petit tableaux, pour le test nous avons commencé avec des tableaux de taille 100, et au lieux de regarder le temps de chaque tri de faire le tri d'un tableau puis d'un autre, etc..., on va juste prendre le temps pour trier tout les tableaux.
En faisant certains test, nous avons aussi remarqué que le tri par insertion est encore plus rapide lorsque les tableaux à traiter sont déjà presque triés.
Tout d'abord pour tester l'hypothèse on fait un petit [script](src/Scripts/hypothese_perf.sh), ce script à été réalisé avec 1000 tableaux de 100 éléments.
```
Suite des commandes, ou script, à exécuter pour produire les données.
./hypothese_perf.sh
```
Ce qui nous donne :
![ceci](src/Images/Tri_insertion_plus_rapide.png)
Donc maintenant il faut faire un tri rapide qui utilise le tri par insertion et l'intégrer au main.
### Résultats expérimentaux
### Analyse des résultats expérimentaux
......
File moved
#!/usr/bin/python
from sys import argv
from math import *
def Helloworld1(n):
count = 0
for i in range(0,n):
for j in range(0, n):
print("Helloworld")
count += 1
return count
def Helloworld2(n):
count = 0
for i in range(0,n):
for j in range(i, n):
print("Helloworld")
count +=1
return count
def Helloworld3(n):
count = 0
if(n>1):
Helloworld3(n/2)
Helloworld3(n-(n/2))
count+=1
print("Helloworld")
return count
def version(i, n):
if(i==1):
l = Helloworld1(n)
print(l)
elif(i==2):
l=Helloworld2(n)
print(l)
elif(i==3):
l=Helloworld3(n)
# print(l)
else:
print("non")
res = log(n)
print("log count : ", res)
print("nb : ", n*res)
if(len(argv[1:])):
versio = int(argv[1])
nb = int(argv[2])
version(versio,nb)
\ No newline at end of file
op = [10, 100, 1000, 10000, 100000, 1000000]
aps = 1000
for i in op:
print("--------------", i, "---------")
print("n : ", i/aps , "s")
print("ln(n) : ", log10(i)/aps , "s")
print("n.log(n) : ", (i*(log10(i)))/aps , "s")
print("nRacine(n) : ", sqrt(i)/aps , "s")
print("n² : ", (pow(i,2))/aps , "s")
print("n³ : ", (pow(i,3))/aps/3600/24 , "jours")
if(i < 10000):
print("2^n : ", (((((pow(2,i))/aps)/3600)/24)/365)/1000000000000000000 , "Quatrillion années")
if(i <1000):
print("fact(n) : ", (((((factorial(i)/aps)/3600)/24)/365)/1000000000000000000) , "Quatrillion années" )
*.o
tri
\ No newline at end of file
src/Images/Tri_insertion_plus_rapide.png

19.7 KiB

src/Images/graphe_memoire.png

184 KiB

src/Images/graphe_temps.png

178 KiB

#include "../Tris/triInsertion.h"
#include "../Tris/triFusion.h"
#include "../Tris/triRapide.h"
#include "../Tris/triBulle.h"
#include "../Tris/triRapideInsertion.h"
#include "../Lib/utils.h"
int main(int argc, char **argv){
if(argc<3){
printf("Usage: ./tri <option> <input.txt> d \n");
exit(1);
}
struct data data;
initData(&data);
if((strcmp(argv[1], "--insertion") == 0) || strcmp(argv[1], "-i")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
// printf("n:%d\n", n);
// printf("Base : ");
// for(int i = 0; i<n; i++){
// printf("%ld-", tab[i]);
// }
// printf("\n");
triInsertion(tab, n);
// printf("Insertion : ");
// for(int i = 0; i<n; i++){
// printf("%ld-", tab[i]);
// }
// printf("\n");
free(tab);
}
else if(strcmp(argv[1], "--fusion")== 0 || strcmp(argv[1], "-f")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
// printf("Base : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
triFusion(tab, n);
// printf("Fusion : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
free(tab);
}
else if((strcmp(argv[1], "--rapide")== 0) || strcmp(argv[1], "-r")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
// printf("Base : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
triRapide(tab, n);
// printf("Rapide : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
free(tab);
}
else if((strcmp(argv[1], "--rapideInsertion")== 0) || strcmp(argv[1], "-ri")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
// printf("Base : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
triRapideInsertion(tab, n);
printf("Rapide : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
free(tab);
}
else if((strcmp(argv[1], "--bulle")== 0) || strcmp(argv[1], "-b")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
// printf("Base : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
triBulle(tab, n);
// printf("Bulle : ");
// for(int i = 0; i<n; i++){
// printf("%ld,", tab[i]);
// }
// printf("\n");
free(tab);
}
else if (strcmp(argv[1], "-a") == 0)
{
int n= 0;
long *tab = readToTab(argv[2], &n);
printf("Base : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
triInsertion(tab, n);
printf("Insertion : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
triFusion(tab, n);
printf("Fusion : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
triRapide(tab, n);
printf("Rapide : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
free(tab);
}
else if (strcmp(argv[1], "-g") == 0)
{
if(argc<4){
printf("Usage: ./tri -g <max> <size>\n");
exit(1);
}
size_t max = atoi(argv[2]);
size_t size = atoi(argv[3]);
long* tab = generate_tab(max, size);
for(size_t i = 0; i<size; i++){
printf("%ld ", tab[i]);
}
printf(".");
printf("\n");
free(tab);
}
else if (strcmp(argv[1], "-gt") == 0)
{
if(argc<4){
printf("Usage: ./tri -gt <max> <size>\n");
exit(1);
}
size_t max = atoi(argv[2]);
size_t size = atoi(argv[3]);
long* tab = generate_tab(max, size);
triRapide(tab, size);
for(size_t i = 0; i<size; i++){
printf("%ld ", tab[i]);
}
printf(".");
printf("\n");
free(tab);
}
else if (strcmp(argv[1], "-gti") == 0)
{
if(argc<4){
printf("Usage: ./tri -gti <max> <size>\n");
exit(1);
}
size_t max = atoi(argv[2]);
size_t size = atoi(argv[3]);
long* tab = generate_tab(max, size);
triRapide(tab, size);
for(size_t i = 0; i < size; i++){
printf("%ld ", tab[size-i-1]);
}
printf(".");
printf("\n");
free(tab);
}
else if (strcmp(argv[1], "-gtp") == 0)
{
if(argc<4){
printf("Usage: ./tri -gtp <max> <size>\n");
exit(1);
}
size_t max = atoi(argv[2]);
size_t size = atoi(argv[3]);
long* tab = generate_tab(max, size);
triRapide(tab, size/2);
for(size_t i = 0; i < size; i++){
printf("%ld ", tab[i]);
}
printf(".");
printf("\n");
free(tab);
}
else if((strcmp(argv[1], "--insertion-verbose") == 0) || strcmp(argv[1], "-iv")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
printf("Base : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
data.time = clock();
triInsertionVerbose(tab, n, &data);
long new_time = (double)clock() - data.time;
data.time = new_time;
printf("Insertion : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
printData(data);
free(tab);
}
else if((strcmp(argv[1], "--fusion-verbose") == 0) || strcmp(argv[1], "-fv")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
printf("Base : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
data.time = clock();
triFusionVerbose(tab, n, &data);
long new_time = (double)clock() - data.time;
data.time = new_time;
printf("Fusion : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
printData(data);
free(tab);
}
else if((strcmp(argv[1], "--rapide-verbose") == 0) || strcmp(argv[1], "-rv")== 0){
int n= 0;
long *tab = readToTab(argv[2], &n);
printf("Base : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
data.time = clock();
triInsertionVerbose(tab, n, &data);
long new_time = (double)clock() - data.time;
data.time = new_time;
printf("Rapide : ");
for(int i = 0; i<n; i++){
printf("%ld,", tab[i]);
}
printf("\n");
printData(data);
free(tab);
}
else{
printf("Usage: ./tri <option> <input.txt> f\n");
}
return 0;
}
\ No newline at end of file
#include "utils.h"
long* readToTab(char* file, int *sizze){
int fd = open(file, O_RDONLY);
if(fd == -1){
perror("open");
exit(1);
}
int n = 0;
int sizet = 1000, nb_size = 1;
int nb_size_tab = 1;
size_t x=0;
char temp;
char* tmp = malloc(sizeof(char)*sizet);
memset(tmp, 0, sizet);
read(fd,&temp,sizeof(char));
int size_tab = 0;
while(temp != '.'){
if(temp == ' '){
size_tab++;
}
read(fd,&temp,sizeof(char));
}
*sizze = size_tab;
lseek(fd, 0, SEEK_SET);
long *tab = malloc(sizeof(long)*size_tab);
read(fd,&temp,sizeof(char));
while(temp != '.'){
// printf("n:%d j:%d nb_size:%d\n", n,j,nb_size);
if(temp != ' '){
tmp[x] = temp;
//printf("tmp[%d] = %c\n", x, temp);
x++;
}
else{
long t = atol(tmp);
tab[n] = t;
//printf("char:%c long:%d n:%d j:%d nb_size:%d, size:%d\n",temp,tab[j], n,j,nb_size, sizet);
memset(tmp, 0, sizet*nb_size);
x=0;
n++;
}
read(fd,&temp,sizeof(char));
}
// for(int i = 0; i<size_tab; i++){
// if(i%15 == 0)
// printf("i:%ld\n",tab[i]);
// else
// printf("i:%ld ", tab[i]);
// }
free(tmp);
return tab;
}
void initData(struct data* d){
d->time = 0;
d->comparison = 0;
d->ct_fusion = 0;
d->ct_parse = 0;
d->write = 0;
}
long* generate_tab(size_t max, size_t length){
if(length==0){
return 0;
}
long* tab = malloc(sizeof(long)*length+1);
memset(tab, 0, sizeof(long)*length+1);
size_t index = 0;
for(index = 0; index<length; index++){
long p = (long)(rand()%max);
tab[index] = p;
}
return tab;
}
void printData(struct data d){
printf("Time passed : %ld\n", d.time);
printf("Number of comparison : %ld\n", d.comparison);
printf("Number of write : %ld\n", d.write);
printf("Call of fusion : %ld\n", d.ct_fusion);
printf("Call of parsing : %ld\n", d.ct_parse);
}
\ No newline at end of file
#ifndef utils_h
#define utils_h
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#define TAB_SIZE 1000
struct data {
long time;
unsigned int write;
unsigned int comparison;
unsigned int ct_fusion;
unsigned int ct_parse;
};
long* readToTab(char* file, int *sizze);
void initData(struct data* d);
long* generate_tab(size_t max, size_t length);
void printData(struct data d);
#endif
library(ggplot2)
perf <- read.table("perf.dat", header = TRUE)
ggplot(perf, aes(x=taille, y=temps, group=tri, colour=tri)) +
geom_point() + geom_smooth() + facet_grid(tri~sort) + ggtitle("Graphe des temps d'exécution")
ggsave("../Images/graphe_temps.png")
ggplot(perf, aes(x=taille, y=mem, group=tri, colour=tri)) +
geom_point() + geom_smooth() + facet_grid(tri~sort) + ggtitle("Graphe des consommations mémoire")
ggsave("../Images/graphe_memoire.png")
\ No newline at end of file
This diff is collapsed.
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1407.683
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 0
cpu cores : 6
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1047.856
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 1
cpu cores : 6
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 2901.758
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 2
cpu cores : 6
apicid : 4
initial apicid : 4
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1043.537
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 3
cpu cores : 6
apicid : 6
initial apicid : 6
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1235.295
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 4
cpu cores : 6
apicid : 8
initial apicid : 8
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1906.872
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 5
cpu cores : 6
apicid : 10
initial apicid : 10
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 6
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1481.748
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 0
cpu cores : 6
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 3437.819
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 1
cpu cores : 6
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 8
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 3619.588
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 2
cpu cores : 6
apicid : 5
initial apicid : 5
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 9
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 3702.932
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 3
cpu cores : 6
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 10
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1067.507
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 4
cpu cores : 6
apicid : 9
initial apicid : 9
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 11
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
stepping : 10
microcode : 0xca
cpu MHz : 1090.700
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 5
cpu cores : 6
apicid : 11
initial apicid : 11
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5202.65
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
#!/bin/bash
for i in "insertion" "fusion" "rapide"
do
echo $i
cmd=$(for j in `seq 1 $3`
do
../tri -g $2 $1 1>../tabs/hypo_tab.txt
../tri --$i ../tabs/hypo_tab.txt
done )
time $cmd
done
\ No newline at end of file
sort iTest taille tri temps mem
Aleatoire 1 91502 insertion 6.43 1668
Aleatoire 1 91502 fusion 0.16 16956
Aleatoire 1 91502 rapide 0.14 1712
Aleatoire 1 91502 bulle 29.58 1620
Trie 1 91502 insertion 0.13 1644
Trie 1 91502 fusion 0.13 16984
Trie 1 91502 rapide 17.76 7428
Trie 1 91502 bulle 12.74 1728
Trie_inverse 1 91502 insertion 12.60 1904
Trie_inverse 1 91502 fusion 0.14 16984
Trie_inverse 1 91502 rapide 10.18 5884
Trie_inverse 1 91502 bulle 20.90 1868
Aleatoire 2 67154 insertion 3.55 1648
Aleatoire 2 67154 fusion 0.15 12444
Aleatoire 2 67154 rapide 0.07 1660
Aleatoire 2 67154 bulle 16.18 1772
Trie 2 67154 insertion 0.09 1728
Trie 2 67154 fusion 0.10 12444
Trie 2 67154 rapide 10.09 5992
Trie 2 67154 bulle 6.96 1668
Trie_inverse 2 67154 insertion 6.88 1640
Trie_inverse 2 67154 fusion 0.10 12484
Trie_inverse 2 67154 rapide 5.89 4528
Trie_inverse 2 67154 bulle 11.16 1620
Aleatoire 3 81151 insertion 5.04 1616
Aleatoire 3 81151 fusion 0.15 14928
Aleatoire 3 81151 rapide 0.10 1712
Aleatoire 3 81151 bulle 23.40 1672
Trie 3 81151 insertion 0.06 1620
Trie 3 81151 fusion 0.13 14868
Trie 3 81151 rapide 14.13 6912
Trie 3 81151 bulle 10.19 1736
Trie_inverse 3 81151 insertion 10.01 1660
Trie_inverse 3 81151 fusion 0.12 14844
Trie_inverse 3 81151 rapide 7.89 5112
Trie_inverse 3 81151 bulle 16.83 1824
Aleatoire 4 34199 insertion 0.93 1404
Aleatoire 4 34199 fusion 0.05 6736
Aleatoire 4 34199 rapide 0.05 1404
Aleatoire 4 34199 bulle 4.13 1456
Trie 4 34199 insertion 0.05 1404
Trie 4 34199 fusion 0.06 6640
Trie 4 34199 rapide 2.62 3560
Trie 4 34199 bulle 1.93 1456
Trie_inverse 4 34199 insertion 1.89 1536
Trie_inverse 4 34199 fusion 0.05 6744
Trie_inverse 4 34199 rapide 1.65 2936
Trie_inverse 4 34199 bulle 3.17 1380
Aleatoire 5 98011 insertion 7.64 1924
Aleatoire 5 98011 fusion 0.11 18092
Aleatoire 5 98011 rapide 0.16 1888
Aleatoire 5 98011 bulle 34.57 2036
Trie 5 98011 insertion 0.10 1904
Trie 5 98011 fusion 0.14 18012
Trie 5 98011 rapide 20.55 8072
Trie 5 98011 bulle 14.75 1908
Trie_inverse 5 98011 insertion 14.65 1972
Trie_inverse 5 98011 fusion 0.10 18012
Trie_inverse 5 98011 rapide 6.35 3972
Trie_inverse 5 98011 bulle 23.93 1880
Aleatoire 6 65648 insertion 3.49 1728
Aleatoire 6 65648 fusion 0.07 12552
Aleatoire 6 65648 rapide 0.09 1728
Aleatoire 6 65648 bulle 15.10 1620
Trie 6 65648 insertion 0.09 1644
Trie 6 65648 fusion 0.12 12552
Trie 6 65648 rapide 9.42 5688
Trie 6 65648 bulle 6.69 1668
Trie_inverse 6 65648 insertion 6.69 1688
Trie_inverse 6 65648 fusion 0.08 12180
Trie_inverse 6 65648 rapide 2.71 2704
Trie_inverse 6 65648 bulle 10.64 1636
Aleatoire 7 75912 insertion 4.45 1624
Aleatoire 7 75912 fusion 0.18 14136
Aleatoire 7 75912 rapide 0.13 1648
Aleatoire 7 75912 bulle 20.41 1744
Trie 7 75912 insertion 0.10 1668
Trie 7 75912 fusion 0.12 14032
Trie 7 75912 rapide 12.38 6372
Trie 7 75912 bulle 8.74 1660
Trie_inverse 7 75912 insertion 8.70 1764
Trie_inverse 7 75912 fusion 0.10 14128
Trie_inverse 7 75912 rapide 6.81 4788
Trie_inverse 7 75912 bulle 14.28 1620
Aleatoire 8 63370 insertion 3.17 1684
Aleatoire 8 63370 fusion 0.12 11920
Aleatoire 8 63370 rapide 0.11 1624
Aleatoire 8 63370 bulle 14.31 1644
Trie 8 63370 insertion 0.06 1620
Trie 8 63370 fusion 0.12 12016
Trie 8 63370 rapide 8.64 5628
Trie 8 63370 bulle 6.14 1660
Trie_inverse 8 63370 insertion 6.08 1616
Trie_inverse 8 63370 fusion 0.09 12016
Trie_inverse 8 63370 rapide 4.51 4000
Trie_inverse 8 63370 bulle 9.96 1668
Aleatoire 9 7508 insertion 0.05 1368
Aleatoire 9 7508 fusion 0.00 2400
Aleatoire 9 7508 rapide 0.01 1424
Aleatoire 9 7508 bulle 0.16 1392
Trie 9 7508 insertion 0.01 1388
Trie 9 7508 fusion 0.01 2448
Trie 9 7508 rapide 0.13 1848
Trie 9 7508 bulle 0.09 1368
Trie_inverse 9 7508 insertion 0.09 1376
Trie_inverse 9 7508 fusion 0.02 2448
Trie_inverse 9 7508 rapide 0.09 1776
Trie_inverse 9 7508 bulle 0.15 1384
Aleatoire 10 55559 insertion 2.40 1396
Aleatoire 10 55559 fusion 0.07 10384
Aleatoire 10 55559 rapide 0.07 1464
Aleatoire 10 55559 bulle 10.91 1600
Trie 10 55559 insertion 0.08 1404
Trie 10 55559 fusion 0.06 10372
Trie 10 55559 rapide 6.66 5068
Trie 10 55559 bulle 4.68 1360
Trie_inverse 10 55559 insertion 4.65 1460
Trie_inverse 10 55559 fusion 0.11 10424
Trie_inverse 10 55559 rapide 3.70 3764
Trie_inverse 10 55559 bulle 7.65 1352
#!/bin/bash
echo -e "sort\tiTest\ttaille\ttri\ttemps\tmem"
for iTest in `seq 1 10`
do
size=$(( `od -An -N4 -tu < /dev/urandom` % 100000))
max=$(( `od -An -N4 -tu < /dev/urandom` % 100000))
for tab in "g" "gt" "gti"
do
../tri -$tab $max $size 1 > ../tabs/perf_tab.txt
if [ $tab = "g" ]
then
sort="Aleatoire"
elif [ $tab = "gt" ]
then
sort="Trie"
elif [ $tab = "gti" ]
then
sort="Trie_inverse"
fi
for tri in "insertion" "fusion" "rapide" "bulle"
do
res=`( /usr/bin/time -f "%U\t%M" ../tri --$tri ../tabs/perf_tab.txt > /dev/null ) 2>&1`
echo -e "$sort\t$iTest\t$size\t$tri\t$res"
done
done
rm ../tabs/perf_tab.txt
done
\ No newline at end of file
#!/bin/bash
echo -e "sort\tiTest\ttaille\ttri\ttemps\tmem"
for iTest in `seq 1 10`
do
size=$(( `od -An -N4 -tu < /dev/urandom` % 100000))
max=$(( `od -An -N4 -tu < /dev/urandom` % 100000))
for tab in "g" "gt" "gti"
do
../tri -$tab $max $size 1 > ../tabs/perf_tab.txt
if [ $tab = "g" ]
then
sort="Aleatoire"
elif [ $tab = "gt" ]
then
sort="Trie"
elif [ $tab = "gti" ]
then
sort="Trie_inverse"
fi
for tri in "insertion" "fusion" "rapide" "bulle"
do
res=`( time -f "%U\t%M" ../tri --$tri ../tabs/perf_tab.txt > /dev/null ) 2>&1`
echo -e "$sort\t$iTest\t$size\t$tri\t$res"
done
done
rm ../tabs/perf_tab.txt
done
\ No newline at end of file
This diff is collapsed.