Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala profiler?

Tags:

scala

profiler

I started to program in Scala recently. I'm looking for a free Scala profiler. Reading from the language's official site led me to YourKit, but the program was not a free one.

Googling "scala profiler" didnt give me any relevant result.

So how do I profile my program written in Scala? I prefer a graphical plugin for Netbeans or Eclipse. But if there is no such thing, then a console one will be fine.

Thanks :)

like image 889
Phil Avatar asked Aug 27 '09 10:08

Phil


2 Answers

Given that Scala runs on the Java Virtual Machine (JVM), you can use the JVM tools JConsole and VisualVM to profile the application. Alternatively any Java profiler should work (e.g. YourKit, as you've already mentioned)

VisualVM has been bundled with the JDK since 1.6.0_10 and it is based on the NetBeans profiler. You can capture memory usage, code performance hotspots etc:

C:> %JAVA_HOME%\bin\jvisualvm 
like image 160
oxbow_lakes Avatar answered Sep 25 '22 12:09

oxbow_lakes


I have tried with jvisualvm (both inside and outside netbeans) but I cannot see any scala method call in the profiling reports (only the underlying java libraries method calls). To me it looks like a bug but I might have missed snomething obvious. Anyway here is a issue report I wrote on netbeans.org with the details:171388

If anybody here has successfully used JVisualVM to CPU-profile Scala code please let me know.

like image 23
ogrisel Avatar answered Sep 22 '22 12:09

ogrisel