[gnome-software] key-colors: Make a colour conversion plugin method inline
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] key-colors: Make a colour conversion plugin method inline
- Date: Wed, 8 Apr 2020 19:54:32 +0000 (UTC)
commit 421a8571007f01b034a3a11497bdc4d83b8341fb
Author: Philip Withnall <withnall endlessm com>
Date: Thu Apr 2 13:10:33 2020 +0100
key-colors: Make a colour conversion plugin method inline
It was being called 80 million times in a trace where I switched between
a couple of categories a few times, and taking 1% of all CPU time in the
trace. Inlining it will reduce some of the calling overheads.
Signed-off-by: Philip Withnall <withnall endlessm com>
plugins/core/gs-plugin-key-colors.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plugins/core/gs-plugin-key-colors.c b/plugins/core/gs-plugin-key-colors.c
index feedfb1d..49efd4a9 100644
--- a/plugins/core/gs-plugin-key-colors.c
+++ b/plugins/core/gs-plugin-key-colors.c
@@ -48,7 +48,7 @@ gs_color_bin_sort_cb (gconstpointer a, gconstpointer b)
}
/* convert range of 0..255 to 0..1 */
-static gdouble
+static inline gdouble
_convert_from_rgb8 (guchar val)
{
return (gdouble) val / 255.f;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]