Adalbert
Adalbert

Reputation: 31

Does Scala use Java collections implementations under the hood?

As a part of academic project I was about to microbenchmark some Java and Kotlin collections behaviours, and compare them to each other.

Recently I found out, that under the hood Kotlin, when run on the JVM, uses the same implementations of collections that Java uses - only adding its own semantics over it - and the conversion is done during compilation, so no changes in runtime are observed.

From the looks of it, Scala collections library is an entirely different world, and although it supports converting Scala to Java collections, it does so through additional converters and not because it shares the codebase, but I couldn't find a statement in the documentation that 100% confirmed it, and would like a second opinion.

TL;DR - Does scala have its own unique collections implementations separate from the core Java codebase?

Upvotes: 3

Views: 103

Answers (0)

Related Questions