From 1460b746b6f5482ce1c56a30af232e824e316e56 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 17 Dec 2015 15:58:06 +0100 Subject: [SERVER] Performance: Optimized some functions (gprof) A run with gprof revealed that background replication is a huge CPU hog. The block selection was very slow and has been improved a lot. Minor improvements were made to other functions that scan the cache map of an image and are thus relatively slow. --- src/server/image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/image.h') diff --git a/src/server/image.h b/src/server/image.h index 25fde37..859507d 100644 --- a/src/server/image.h +++ b/src/server/image.h @@ -43,7 +43,7 @@ bool image_generateCrcFile(char *image); json_t* image_getListAsJson(); -int image_getCompletenessEstimate(const dnbd3_image_t * const image); +int image_getCompletenessEstimate(dnbd3_image_t * const image); // one byte in the map covers 8 4kib blocks, so 32kib per byte // "+ (1 << 15) - 1" is required to account for the last bit of -- cgit v1.2.3-55-g7522