C++ wins in programming language benchmark conducted by Google

By Kshitij Sobti | Published on 12 Jun 2011
C++ wins in programming language benchmark conducted by Google

Google recently conducted a benchmark of 4 programming languages Java, C , Scala, and Go, a programming language developed by Google themselves.

Google first published the benchmark internally, and as Google engineers started creating more optimized versions of their benchmarks, Google was further able to deduce the pain points in performance optimization in different languages.

The algorithm created by Google was a simple one that makes use of many language features such as "higher-level data structures (lists, maps, lists and arrays of sets and lists), a few algorithms (union/find, dfs / deep recursion, and loop recognition based on Tarjan), iterations  over collection types, some object oriented features, and interesting memory allocation patterns"

What the algorithm doesn't explore are "aspects of multi-threading, or higher level type mechanisms, which vary greatly between the languages"

The benchmark algorithm itself is open source and available at Google Code. This includes the optimized versions of the benchmark for all languages except C , since that code depends on code Google would rather nor open-source.

When it comes to the size of code, Scala and Go implementations were much shorter than the C and Java versions.In compilation time, Google's Go comes out at top, with even the fastest compilation times of other languages being 5 times slower.

On the other hand, Go has the largest compiled binary sizes, of as much as 94 times that of Java. Since Java and Scala are compiled to bytecode, they tend to be smaller, but not much smaller than the optimized C build. In memory usage, C has the advantage, followed by Scala, Go and last Java.

In terms of performance, Google's conclusion indicates that C is the best performer by a large margin, but "required the most extensive tuning efforts, many of which were done at a level of sophistication that would not be available to the average programmer"

Scala and Java run on the same JVM, and hence has the same issues in analyzing performance, and tuning garbage collection. Scala, however "allowed  for the best optimization of code complexity"

Go was deemed interesting, but immature looking at the performance and binary sizes.

To read the full report by Google, click here to download the PDF of the report.

Digit caters to the largest community of tech buyers, users and enthusiasts in India. The all new Digit in continues the legacy of Thinkdigit.com as one of the largest portals in India committed to technology users and buyers. Digit is also one of the most trusted names when it comes to technology reviews and buying advice and is home to the Digit Test Lab, India's most proficient center for testing and reviewing technology products.

We are about leadership-the 9.9 kind! Building a leading media company out of India.And,grooming new leaders for this promising industry.

DMCA.com Protection Status