title: C - Is sorting an array of pointers of structs slower than sorting the structs directly (qsort)
body: <p>I am sorting millions of structs organzied in an array with the qsort-function of the standard c library. I tried to optimize the performance by creating an array of pointers of the struct with the same length. In contrast to my expectations the execution time of the second variant is slower:</p>
  
  <p>qsort an array of structs: 199s
  qsort an array of pointers of structs: 204</p>
  
  <p>I expected that the time for swapping pointer blocks in the memory would be faster than moving structs (size 576). May I have any performance leaks or is this a known behaviour?</p>