Comparaison entre l'allocation d'un tableau sur le heap et sur la stack. More...
Macros | |
#define | N 100 |
#define | SIZE_1 0x1000 |
#define | SIZE_2 0x10000 |
#define | SIZE_3 0x100000 |
Functions | |
char | stack_1 () |
allocation d'un tableau de taille SIZE_1 sur la stack More... | |
char | stack_2 () |
allocation d'un tableau de taille SIZE_2 sur la stack More... | |
char | stack_3 () |
allocation d'un tableau de taille SIZE_3 sur la stack More... | |
char | heap_1 () |
allocation d'un tableau de taille SIZE_1 sur le heap More... | |
char | heap_2 () |
allocation d'un tableau de taille SIZE_1 sur le heap More... | |
char | heap_3 () |
allocation d'un tableau de taille SIZE_1 sur le heap More... | |
void | benchmark_fun (timer *t, char(*fun)(), recorder *rec, int x) |
Mesure N appels de fun More... | |
int | main (int argc, char *argv[]) |
Comparaison entre l'allocation d'un tableau sur le heap et sur la stack.
#define N 100 |
#define SIZE_1 0x1000 |
#define SIZE_2 0x10000 |
#define SIZE_3 0x100000 |
Mesure N
appels de fun
t | timer utilisé pour la mesure du temps |
fun | fonction dont on mesure les performances |
rec | recorder dans lequel on enregistre le temps |
x | abscisse à laquel on enregistre le temps |
char heap_1 | ( | ) |
allocation d'un tableau de taille SIZE_1
sur le heap
Le free
a été commenté pour voir l'effet du remplissage du heap
. Décommentez le pour voir ce que ça change.
char heap_2 | ( | ) |
char heap_3 | ( | ) |
int main | ( | int | argc, |
char * | argv[] | ||
) |
char stack_1 | ( | ) |
char stack_2 | ( | ) |