We already have a fast implementation of is_zero(memory), we should use
it instead of using memcmp with temp struct on stack. This change reduces
object_stat_sum_t.is_zero() CPU usage by 35-50%.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
#include "include/CompatSet.h"
#include "common/histogram.h"
#include "include/interval_set.h"
+#include "include/inline_memory.h"
#include "common/Formatter.h"
#include "common/bloom_filter.hpp"
#include "common/hobject.h"
}
bool is_zero() const {
- object_stat_sum_t zero;
- return memcmp(this, &zero, sizeof(zero)) == 0;
+ return mem_is_zero((char*)this, sizeof(*this));
}
void add(const object_stat_sum_t& o);