Page MenuHomePhabricator

[libc] Add differential and performance targets for sqrtf
ClosedPublic

Authored by hedingarcia on Jul 31 2021, 12:03 PM.

Details

Summary

Comparing the runtime of the sqrt functions from LLVM libc with the system libc:

functionperf - LLVM libcperf - MSVCRT
sqrtf - Windows44.05 sec (44051715500 ns)417.84 sec (417843359900 ns) = 6.96 mins
functionperf - LLVM libcperf - glibc
sqrtf - Linux30.48 sec (30479458632 ns)43.72 sec (43716901527 ns)

By running the differential test:

functiondiff
sqrtf - Windows0 differing results
sqrtf - Linux0 differing results

Diff Detail

Event Timeline

hedingarcia created this revision.Jul 31 2021, 12:03 PM
hedingarcia requested review of this revision.Jul 31 2021, 12:03 PM

Do you have any results to share?

Yes, comparing the runtime of the sqrt functions from LLVM libc with the system libc:

functionperf - LLVM libcperf - MSVCRT
sqrtf - Windows44.05 sec (44051715500 ns)417.84 sec (417843359900 ns) = 6.96 mins
functionperf - LLVM libcperf - glibc
sqrtf - Linux30.48 sec (30479458632 ns)43.72 sec (43716901527 ns)

And by running the differential test:

functiondiff
sqrtf - Windows0 differing results
sqrtf - Linux0 differing results
sivachandra accepted this revision.Aug 2 2021, 11:19 AM

Thanks a lot for sharing.

This revision is now accepted and ready to land.Aug 2 2021, 11:19 AM

putting the stats in the description would be nice

libc/test/src/math/differential_testing/sqrtf_diff.cpp
2–3

these are messed up, should be one line

libc/test/src/math/differential_testing/sqrtf_perf.cpp
2–3

ditto

[libc] Fixed comments format

hedingarcia edited the summary of this revision. (Show Details)Aug 2 2021, 11:48 AM
hedingarcia edited the summary of this revision. (Show Details)