https://github.com/msink/kotlin-pi
Performance test: computes n decimal digits of π
https://github.com/msink/kotlin-pi
kotlin kotlin-native
Last synced: 5 months ago
JSON representation
Performance test: computes n decimal digits of π
- Host: GitHub
- URL: https://github.com/msink/kotlin-pi
- Owner: msink
- License: apache-2.0
- Created: 2017-11-13T13:32:22.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-28T08:02:45.000Z (over 7 years ago)
- Last Synced: 2025-03-29T19:11:18.498Z (9 months ago)
- Topics: kotlin, kotlin-native
- Language: C
- Homepage:
- Size: 92.8 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Testbench for [Kotlin/Native EAP](https://github.com/JetBrains/kotlin-native)
[](https://ci.appveyor.com/project/msink/kotlin-pi)
[](https://travis-ci.org/msink/kotlin-pi)
The original pi.c was taken from http://bellard.org/pi/pi.c
(added a plain loop to calculate digits from 1 to n instead of digits around n-th)
Computing 1000 decimal digits of π, average time on 20 runs:
| | |
| :--------------------------- | :------------- |
| C | 6.8 sec |
| Kotlin/Native interop with C | 6.8 sec |
| Kotlin/Native 0.7 EAP | 6.9 sec |
| Kotlin/Native 0.6.2 EAP | 9.3 sec |
| Kotlin/Native 0.6 EAP | 10.2 sec |
| Kotlin/Native 0.4 EAP | 11.4 sec |
Result - performance in this test is almost identical, Kotlin is approx. 2% slower.
But it is EAP, so even that 2% may be fixed in next versions.