Repository navigation
Replies: 8 comments
|
The problem with this approach to profiling is that it impacts the profiled methods. Our optimizer can eliminate methods that don't include state mutation but once we do that it disables such optimizations and can waste your time with an illusion of data. I'm not saying it isn't useful for some cases, but I think it would be problematic in the framework as people don't really read docs and would trust its results. |
|
it would be something you turn on only when doing a tuning pass |
|
I understand that. The value of a profiler is in its relative accuracy: methodA is 1.3x the speed of methodC and is invoked 3x more often. Unfortunately, due to the optimizer in Codename One this approach you took will give you wrong results not just in absolute numbers but also in relative numbers as you're effectively disabling some optimizations that can lead you down the path of optimizing non-issues and possibly regressing the code. The way profiling should work is through stack snapshots which doesn't impact the running applications optimization. |
|
i agree but lacking a mechanism to do that, what else is possible? something is better than nothing. |
|
We use the xcode profiler and Android based profiling. Especially the xcode profiling/memory analysis tools are really good. |
|
doesn't apply to abnormal javascript performance debugging. |
|
You can use chrome profiling to benchmark JavaScript which is what we use. But since we used it locally I hadn't noticed we don't publish mapping files as a standard part of the build which makes it harder to see a deobfuscated stack when profiling. We'll add the mapping file that would make it easier to read that output. |
|
inded. i looked into the builtin profiler and saw nothing informative. |
Uh oh!
There was an error while loading. Please reload this page.
Inspired by the lack of metering tools for mobiles and javascript, I came up with a model that requires minimal code
modification. It occurs to me that this could be done automatically by parpavm, and maybe also the android recoder.
Here's the primitive skeleton of the profiler:
import java.util.Enumeration;
public class Meter {
}
This requires a simple mod to the functions to be metered.
public int someFunction()
{
.... do whatever
Meter.count("copyTheBoardNow");
return value;
}
Obviously need to be smart about multiple exits and so on. Also could be extended to include per-function timing.
This could be communicated to parpavm by including a magic directive as a static variable in a class file, or
by a global directive to the build process.
All reactions