Closed heshpdx closed 10 months ago
FWIW, h3o only uses double
(since long double
no longer exists in Rust), so it's likely possible to get rid of long double
on every platform without impacting the correctness
Thanks for the PR!
I remember removing some uses of long double
before (I was checking if that was in the Git history and didn't see it, maybe it was before we open sourced the library?). I am pretty comfortable with removing remaining long double
usage.
Thanks for the PR!
I remember removing some uses of
long double
before (I was checking if that was in the Git history and didn't see it, maybe it was before we open sourced the library?). I am pretty comfortable with removing remaininglong double
usage.
Everything was long double
when we started, until it became clear that was unnecessary. When we switched to double
some of them must have been missed.
I measured a 40% performance uplift on an Ampere Altra QS80-30 on the benchmark cmdline below. Building with gcc-12 -O3, runtime dropped from 481s to 340s.
./h3geo 110,10,25,82 vertex,is_valid_cell,grid_disk_cells,grid_path_cells
On aarch64 systems, we are seeing a significant overhead in libgcc - __multf3.
This overhead is due to the usage of lroundl in coordijk.c. To prevent this overhead, we are proposing to replace long double type with double type and use lround instead of lroundl. This should have no impact on other systems than aarch64. We have verified the behavior matches on some test cases. For coherency sake, we also changed long double constants to double type.
This was found by the SPEC CPU committee, where h3 is being considered as a candidate benchmark for SPEC CPU v8 and undergoing testing across a wide variety of systems and compilers.
Feel free to squash these commits.