Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13342] Profiler: Android: results are inconsistent and lacking some function calls

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionNot Our Bug
Resolution Date2013-06-11T18:52:41.000+0000
Affected Version/sRelease 3.1.0, Release 3.1.1
Fix Version/sn/a
ComponentsAndroid, Tooling
Labelsqe-3.1.0, qe-3.1.1
ReporterDustin Hyde
AssigneeMax Stepanov
Created2013-04-03T03:43:28.000+0000
Updated2013-06-11T18:52:41.000+0000

Description

If you run more than one to three snapshots for Android, all results are one node: (program) 100% The other nodes only appear on the creation of the first few snapshots. Test Steps: 1. Run code (app.js) in Android Profiler:
var string = '0123456789';

function complexity_constant()
{
	console.log(string);
}

function complexity_linear()
{
	for(i in string)
		console.log(string[i]);
}

function complexity_quadratic()
{
	for(i in string)
		for(j in string)
			console.log(string[i] + ',' + string[j]);
}

var win = Ti.UI.createWindow({
	layout:'vertical',
	backgroundColor:'white'
});

function createButton(title, e)
{
	var button = Ti.UI.createButton({
		title:title
	});
	
	button.addEventListener('click', e);
	
	win.add(button);
}

createButton('constant', complexity_constant);
createButton('linear', complexity_linear);
createButton('quadratic', complexity_quadratic);

win.open();
2. Create a few snapshots and click on some of the buttons. Test Results: After a few snapshots, all data stops appearing.

Attachments

FileDateSize
alloy_android_device_session_1.hprof2013-06-07T22:34:24.000+0000598
alloy_android_device_session_2.hprof2013-06-07T22:34:24.000+0000263
alloy_android_device_session_3.hprof2013-06-07T22:34:24.000+0000598
alloy_android_device_session_4.hprof2013-06-07T22:34:24.000+0000493
alloy_android_device_session_5.hprof2013-06-07T22:34:24.000+0000361
alloy_android_device_session_6.hprof2013-06-07T22:34:24.000+0000500

Comments

  1. Michael Xia 2013-04-03

    This doesn't appear to be a Studio issue. We display the data for what we get for each profiling session, and the data here only contains the idle entry. Need Max to take a look at it.
  2. Max Stepanov 2013-04-03

    I turned on profiler logging and here is what reported from underlying V8 profiler APIs:
       [ERROR][TiProfiler(  384)] --down
       [ERROR][TiProfiler(  384)] func = (program), source = , lineNo = 0, cost = 0.200000
       [ERROR][TiProfiler(  384)] --up
       [ERROR][TiProfiler(  384)] --done
       
    This might be related to JIT optimizations, or a bug in V8 profiler. The issue is only seen on Emulator, cannot reproduce on device.
  3. Dustin Hyde 2013-06-07

    I am attaching some alloy profile sessions on the default alloy project. For each session, I clicked on the hello world button three times. I seem to get the results as time progresses, so I don't see this issue (of the results disappearing over time) for alloy on android device. However, the results are different each time, possibly related to the time being too close to zero, and thus not showing up.
  4. Ingo Muschenetz 2013-06-07

    Reclosing as not our bug for now. Perhaps upgrading V8 might help.
  5. Dustin Hyde 2013-06-07

    Closing.

JSON Source