mirror of
https://github.com/rui314/mold.git
synced 2024-10-05 17:17:40 +03:00
replace pow(2,x) by ldexp(1.0,x) for performance
This commit is contained in:
parent
2d25a93126
commit
b685f3cab7
@ -13,7 +13,7 @@ namespace mold {
|
||||
i64 HyperLogLog::get_cardinality() const {
|
||||
double z = 0;
|
||||
for (i64 val : buckets)
|
||||
z += pow(2, -val);
|
||||
z += std::ldexp(1.0, -val);
|
||||
return ALPHA * NBUCKETS * NBUCKETS / z;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user