mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof: use gtk_tim_sort() for counter value sorting
This is generally faster than g_array_sort() due to all the heuristics involved, which are likely to hold true for us with counter data.
This commit is contained in:
@ -22,6 +22,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "timsort/gtktimsortprivate.h"
|
||||
|
||||
#include "sysprof-document-counter-private.h"
|
||||
#include "sysprof-document-counter-value-private.h"
|
||||
#include "sysprof-document-private.h"
|
||||
@ -358,7 +360,11 @@ _sysprof_document_counter_calculate_range (SysprofDocumentCounter *self)
|
||||
if (self->values->len == 0)
|
||||
return;
|
||||
|
||||
g_array_sort (self->values, sort_by_time);
|
||||
gtk_tim_sort (self->values->data,
|
||||
self->values->len,
|
||||
sizeof (SysprofDocumentTimedValue),
|
||||
(GCompareDataFunc)sort_by_time,
|
||||
NULL);
|
||||
|
||||
values = &g_array_index (self->values, SysprofDocumentTimedValue, 0);
|
||||
n_values = self->values->len;
|
||||
|
||||
Reference in New Issue
Block a user