andreasgal/j2me.js — pull request #304 by mykmelez (2014-09-22 09:11:01+00:00)
Title: Java call profiler

This is a simple Java call profiler that prints the time spent executing each method. It excludes the time spent in a callee, and the time spent while the thread is paused, so the times it reports should be strictly for the time spent in the method itself.

Press the Profile button to start profiling. Press it again to stop profiling and log a report. You can also start profiling on pageload by adding `profile=1` to the URL query parameters.

Profile entries are sorted by total time spent (in descending order) and comprise the total time spent, number of calls, and class.name.signature of the method, f.e.:

```
914ms 137 com/sun/cldc/i18n/j2me/UTF_8_Reader.read.([CII)I
```

Which says that 914 milliseconds were spent in 137 calls to *com/sun/cldc/i18n/j2me/UTF_8_Reader.read.([CII)I*.

There are four "synthetic" methods, i.e. frames implemented in JavaScript, that are identified by a name that ends with "Synthetic", sometimes followed by a colon and some additional identifier, like the class name or a class.method.signature triple.