Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the performance difference between Scala2.10 and 2.9.2?

Shulou Source: shulou.com Published: 2022-06-03 11:13:21 11月15日 Update

In this issue, the editor will bring you about the performance difference between Scala2.10 and 2.9.2. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.

I have read some of the new features of Scala 2.10.0-RC3, and the most interesting thing about this version is the performance improvement. I was curious about the extent of the improvement, so I did a benchmark test. Here are the code for my two tests:

Eratosthenes screening

Def eratosthenes (toNum: Int) = {def sieveHelp (r: IndexedSeq [Int]): Stream [Int] = {if (r.isEmpty) Stream.empty else r.head #:: sieveHelp (r.tail.filterNot (_% r.head = = 0))} sieveHelp (2 +: (3 to toNum by 2))}

Sundaram screening

Def sundaram (toNum: Int) = {val n = (toNum-2) / 2 val nonPrimes = for (I

Tags: Performance method test content that is aspect prime analysis run curiosity trivial above professional two small and medium code rich content benchmark amplitude article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple NVidia MariaDB Redmi