diff options
author | Simon Rettberg | 2015-12-17 15:58:06 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-12-17 15:58:06 +0100 |
commit | 1460b746b6f5482ce1c56a30af232e824e316e56 (patch) | |
tree | 12d170ec73fe3eba66db779a38be36e86052be66 /src/server/image.h | |
parent | [SERVER] image_markComplete now handles locking so we remove() unlocked (diff) | |
download | dnbd3-1460b746b6f5482ce1c56a30af232e824e316e56.tar.gz dnbd3-1460b746b6f5482ce1c56a30af232e824e316e56.tar.xz dnbd3-1460b746b6f5482ce1c56a30af232e824e316e56.zip |
[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.
Diffstat (limited to 'src/server/image.h')
-rw-r--r-- | src/server/image.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 |