JuliaMath / JuliaMath/openlibm
Openlibm's `pow`, `hypot`, `exp` and `log` are considerably slower than Glibc's
- Dominant language
- C
- Stars
- 632
- Forks
- 163
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
I just ran benchmarks of openlibm (compiled by gcc and clang) and system libm (Glibc), and these were the results:
```
openlibm(gcc) syslibm openlibm(clang)
pow : 17.4427 MPS : 69.7010 MPS : 18.1047 MPS
hypot : 72.7657 MPS : 107.5491 MPS : 76.4914 MPS
exp : 132.5313 MPS : 197.3627 MPS : 145.4958 MPS
log : 129.2455 MPS : 216.8139 MPS : 130.2769 MPS
log10 : 103.1023 MPS : 118.6334 MPS : 96.9040 MPS
sin : 176.9966 MPS : 157.4333 MPS : 150.2365 MPS
cos : 162.1996 MPS : 166.1857 MPS : 161.8407 MPS
tan : 93.6082 MPS : 76.9096 MPS : 90.7496 MPS
asin : 124.9897 MPS : 114.8927 MPS : 128.0259 MPS
acos : 140.7629 MPS : 110.8343 MPS : 129.6873 MPS
atan : 120.1154 MPS : 79.6637 MPS : 130.1246 MPS
atan2 : 54.1519 MPS : 43.4398 MPS : 58.3252 MPS
```
System Libm is considerably faster than Openlibm on `pow` (4x) `hypot`, (1.5x) `exp` (1.5x) and `log` (1.7x), while Openlibm outperforms system Libm in almost all trigonometric functions (except `cos`).
Running on Kubuntu 21.04 (kernel 5.11.0-17-generic) in an Asus Rog Strix G531GT, CPU Intel Core i7-9750H CPU 2.60GHz.
Edit:
GNU libc version: 2.33
GNU libc release: release
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.