4953 shaares
Ohhhh ce benchmark sur Kotlin ! Sur certains points Kotlin est plus rapide que Java mais pas tout le temps et il y a des choses à éviter absolument comme les varargs.
Pour résumer l'article :
| Plus rapide que Java | Mois rapide que Java |
|---|---|
| ✅ Higher-order functions | ⛔️ Varargs + Spread Operator |
| ✅ Lambda expressions | ⛔️ Delegate Properties |
| ✅ Companion Objects | ⛔️ Ranges (forEach function) |
| ✅ Local Functions | |
| ✅ Null safety | |
| ✅ Indirect access to Range | |
| ✅ Ranges (local, non-primitive types) | |
| ✅ Ranges (iteration with explicit step) | |
| ✅ Use of indices on custom collection |