diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-11-01 15:28:43 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-11-01 18:01:33 -0700 |
commit | 0500b3cfda5192efc09d6d4344b0c6c785c0a815 (patch) | |
tree | d850844c43e6dacd62f9818f39a8becfd5ac5cbb /tests/FrameworkPerf/src | |
parent | f136aa341abaaf7fd6f7632d41a30b2989d93985 (diff) |
Some optimizations.
- Don't try to create a thumbnail bitmap on the client side. This
wastes 64k, and isn't needed since we are doing screenshots.
- Optimize View to put all of the callback pointers out of line.
Added a couple new APIs so these don't need to be protected/public.
- Lazily create ViewGroup's cache paint.
- Change FrameworkPerf app to not use HW accel drawing, to give better
comparison with GB.
Change-Id: Iec56d02459820d74a4cc9c7ec9c1856563c82c7b
Diffstat (limited to 'tests/FrameworkPerf/src')
-rw-r--r-- | tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java index 66e788c824a4..5e152245638b 100644 --- a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java +++ b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java @@ -58,6 +58,7 @@ public class FrameworkPerfActivity extends Activity Spinner mFgSpinner; Spinner mBgSpinner; TextView mLog; + TextView mTestTime; PowerManager.WakeLock mPartialWakeLock; long mMaxRunTime = 5000; @@ -110,6 +111,7 @@ public class FrameworkPerfActivity extends Activity }; final Op[] mAvailOps = new Op[] { + null, new NoOp(), new CpuOp(), new SchedulerOp(), @@ -122,6 +124,8 @@ public class FrameworkPerfActivity extends Activity new ReadFileOp(), new ParseXmlResOp(), new ParseLargeXmlResOp(), + new LayoutInflaterOp(), + new LayoutInflaterLargeOp(), new LoadSmallBitmapOp(), new LoadLargeBitmapOp(), new LoadSmallScaledBitmapOp(), @@ -170,11 +174,14 @@ public class FrameworkPerfActivity extends Activity mAvailOpDescriptions = new String[mAvailOps.length]; for (int i=0; i<mAvailOps.length; i++) { Op op = mAvailOps[i]; - if (op.getClass() == NoOp.class) { + if (op == null) { mAvailOpLabels[i] = "All"; mAvailOpDescriptions[i] = "All tests"; } else { mAvailOpLabels[i] = op.getName(); + if (mAvailOpLabels[i] == null) { + mAvailOpLabels[i] = "Nothing"; + } mAvailOpDescriptions[i] = op.getLongName(); } } @@ -211,6 +218,7 @@ public class FrameworkPerfActivity extends Activity stopRunning(); } }); + mTestTime = (TextView)findViewById(R.id.testtime); mLog = (TextView)findViewById(R.id.log); PowerManager pm = (PowerManager)getSystemService(POWER_SERVICE); @@ -221,11 +229,7 @@ public class FrameworkPerfActivity extends Activity @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (parent == mFgSpinner || parent == mBgSpinner) { - Spinner spinner = (Spinner)parent; Op op = mAvailOps[position]; - if (op.getClass() == NoOp.class) { - op = null; - } if (parent == mFgSpinner) { mFgTest = op; ((TextView)findViewById(R.id.fgtext)).setText(mAvailOpDescriptions[position]); @@ -238,8 +242,6 @@ public class FrameworkPerfActivity extends Activity @Override public void onNothingSelected(AdapterView<?> parent) { - // TODO Auto-generated method stub - } @Override @@ -314,6 +316,7 @@ public class FrameworkPerfActivity extends Activity updateWakeLock(); startService(new Intent(this, SchedulerService.class)); mCurOpIndex = 0; + mMaxRunTime = Integer.parseInt(mTestTime.getText().toString()); mResults.clear(); startCurOp(); } |