Trying another fix

This commit is contained in:
alesapin 2020-10-20 23:05:20 +03:00
parent 439bbd9861
commit 8097c696de

View File

@ -90,9 +90,6 @@ double mapPiecewiseLinearToUnit(double value, double min, double max)
/** Is allowed to merge parts in range with specific properties.
*/
#if defined(__clang__)
ALWAYS_INLINE
#endif
bool allow(
double sum_size,
double max_size,
@ -104,7 +101,9 @@ bool allow(
// std::cerr << "sum_size: " << sum_size << "\n";
/// Map size to 0..1 using logarithmic scale
double size_normalized = mapPiecewiseLinearToUnit(log1p(sum_size), log1p(settings.min_size_to_lower_base), log1p(settings.max_size_to_lower_base));
/// Use log(1 + x) instead of log1p(x) because our x variables (sum_size and settings) are always integer.
/// Also log1p seems to be slow and significantly affect performance of merges assignment.
double size_normalized = mapPiecewiseLinearToUnit(log(1 + sum_size), log(1 + settings.min_size_to_lower_base), log(1 + settings.max_size_to_lower_base));
// std::cerr << "size_normalized: " << size_normalized << "\n";