Skip to content

Case Study: Scala’s Compiler – A Preamble

At JINSPIRED we are always on the look out for applications which create enormous challenges for application performance measurement solutions. We hold the view that if JXInsight/OpenCore can scale not just in terms of latency and throughput but in complexity as well then everything else will be relatively easy and in general much more efficiently addressed. It is for this very reason that JXInsight/OpenCore’s metering runtime is unique in the degree of extensibility it affords in how and when a software activity (method) is metered (measured).

With over 50 built-in optional metering extensions, 20 of which are strategy based, there is simply no behavior or consumption pattern that cannot be detected and metered (measured) and that includes call stack depths (especially very deep ones) as previously described in the article How to Meter Anything: Focus on Change (PDF). At least that is what we like to believe.

Recently it was brought to our attention that Scala’s (2.9.1) compiler had performance problems which had challenged the engineering team and the profiling tools used in attempting to accurately identifying the underlying root causes (contributing factors). When we take on such work whether its via our benchmarking service we offer software vendors or on our own initiative the first thing we do is run through a check list of runtime inspection extensions some of which focus on caller-to-callee execution behavior looking for recursive patterns and resulting deep call sequences which can unduly impact the relevance and accuracy of the model.

We have seen a fair share of deep call stacks but nothing prepared us for this one (25 pages long!!!) we identified during our preliminary investigations. With a depth of over 1900 it is truly amazing what you can throw at the JVM and live to tell the tale.

Note: Whilst our metering runtime could detect and print this huge call stack dump we had to add the argument, -XX:MaxJavaStackTraceDepth=2000, to the command line to get the JVM to print it itself.

In part 1 of this series on Scala’s compiler we will show how a professional software performance engineer using JXInsight/OpenCore advance and adaptive measurement capabilities goes about reducing the noise and eliminating overhead in the measurement of such unusual software execution behavior. And in the course demonstrate very clearly why JXInsight/OpenCore is generations ahead of the competition in every regard.