Skip to main content
QUICK REVIEW

[Paper Review] Clash of the Lambdas

Aggelos Biboudis, Nick Palladinos|arXiv (Cornell University)|Jun 25, 2014
Advanced Database Systems and QueriesComputer Science7 references8 citations
TL;DR

This paper evaluates the performance of lambda-based streaming APIs across Java, C#, F#, and Scala on JVM and .NET platforms, measuring microbenchmarking results to isolate implementation costs. It finds that Java's mature JIT and implementation techniques yield high performance, while optimizing frameworks like ScalaBlitz and LinqOptimizer significantly improve efficiency for common query patterns.

ABSTRACT

The introduction of lambdas in Java 8 completes the slate of statically-typed, mainstream languages with both object-oriented and functional features. The main motivation for lambdas in Java has been to facilitate stream-based declarative APIs, and, therefore, easier parallelism. In this paper, we evaluate the performance impact of lambda abstraction employed in stream processing, for a variety of high-level languages that run on a virtual machine (C#, F#, Java and Scala) and runtime platforms (JVM on Linux and Windows, .NET CLR for Windows, Mono for Linux). Furthermore, we evaluate the performance gain that two optimizing libraries (ScalaBlitz and LinqOptimizer) can offer for C#, F# and Scala. Our study is based on small-scale throughput-benchmarking, with significant care to isolate different factors, consult experts on the systems involved, and identify causes and opportunities. We find that Java exhibits high implementation maturity, which is a dominant factor in benchmarks. At the same time, optimizing frameworks can be highly effective for common query patterns.

Motivation & Objective

  • To evaluate the performance overhead of lambda abstractions in streaming APIs across multiple high-level, VM-based languages.
  • To compare implementation maturity and optimization effectiveness across Java, C#, F#, and Scala on different runtime platforms (JVM and .NET).
  • To assess the impact of optimizing libraries (e.g., ScalaBlitz, LinqOptimizer) on common streaming workloads.
  • To isolate and analyze performance bottlenecks such as boxing, GC pressure, and JIT behavior in lambda-heavy workloads.
  • To explore whether internal iteration or external iteration in stream APIs affects performance and scalability.

Proposed method

  • Conducted micro-benchmarking on Linux and Windows platforms using equivalent data types and semantic abstractions across all languages.
  • Used a controlled benchmark suite with increasing complexity, starting from basic operations like sum of even squares to complex pipelines with multiple combinators.
  • Measured both sequential and parallel performance, focusing on throughput and GC behavior.
  • Applied expert-guided tuning, including disabling tiered compilation to isolate JIT behavior effects.
  • Evaluated the impact of manual boxing (via refs benchmark) to compare languages without incidental overheads.
  • Explored the use of specialized libraries (ScalaBlitz, LinqOptimizer) and compiler plugins (e.g., Miniboxing) to reduce runtime costs.

Experimental results

Research questions

  • RQ1How do the performance characteristics of lambda-based streaming APIs compare across Java, C#, F#, and Scala on JVM and .NET platforms?
  • RQ2To what extent does implementation maturity in the Java runtime (e.g., C2 JIT) dominate performance in lambda-heavy workloads?
  • RQ3How effective are optimizing frameworks like ScalaBlitz and LinqOptimizer in reducing the cost of common streaming query patterns?
  • RQ4What role does automatic boxing play in performance degradation, and how does manual boxing affect cross-language comparison?
  • RQ5How does JIT compilation behavior (especially tiered compilation) influence performance in Scala and Java benchmarks?

Key findings

  • Java exhibits high implementation maturity, with the C2 JIT compiler delivering consistently strong performance across all benchmarks.
  • Disabling tiered compilation improved performance in most Scala and Java benchmarks, with a ~10% degradation observed when enabled in Scala.
  • In the refs benchmark (manual boxing), Java outperformed others by a small margin, but Scala’s performance became directly comparable due to absence of incidental boxing.
  • The Scala-strict parallel test achieved high competitiveness due to near-perfect inlining of the internal transformer and efficient memory usage.
  • In the Filtered trait of Scala, internal boxing from the lazy value in the length operator caused measurable GC pressure, even in parallel execution.
  • Optimizing frameworks like ScalaBlitz and LinqOptimizer demonstrated significant performance gains for common query patterns, suggesting strong potential for similar tools in Java.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.