using Tizen.NUI.Constants;
-class PerfNewExample : NUIApplication
+class PerformanceTestExample : NUIApplication
{
const uint ROWS_COUNT = 32;
const uint COLUMNS_COUNT = 32;
const uint DURATION_PER_COLUMNS = 50; // miliseconds
const float VIEW_MARGIN_RATE = 0.1f;
enum ViewTestType{
- TEST_TYPE_COLOR = 0, ///< Test with simple color
- TEST_TYPE_IMAGE, ///< Test with simple image
- TEST_TYPE_TEXT, ///< Test with simple text label
- TEST_TYPE_ROUNDED_COLOR, ///< Test with rounded color
+ TEST_TYPE_COLOR = 0, ///< Test with simple color
+ TEST_TYPE_IMAGE, ///< Test with simple image
+ TEST_TYPE_TEXT, ///< Test with simple text label
+ TEST_TYPE_ROUNDED_COLOR, ///< Test with rounded color
#if ALLOW_BORDER_AND_BLUR
TEST_TYPE_BORDER_COLOR, ///< Test with borderline color
TEST_TYPE_ROUNDED_BORDER_COLOR, ///< Test with rounded borderline color
}
};
Statistic mCreationStatistic;
- global::System.Collections.Generic.LinkedList<View> mViewList;
- global::System.Collections.Generic.LinkedList<Timer> mTimerList;
Window mWindow;
Vector2 mWindowSize;
Vector2 mSize;
ViewTestType mTestType = ViewTestType.TEST_TYPE_COLOR;
+ // To keep reference count.
+ global::System.Collections.Generic.LinkedList<View> mViewList;
+ global::System.Collections.Generic.LinkedList<Timer> mTimerList;
+ global::System.Collections.Generic.LinkedList<Animation> mAnimationList;
+
uint mColumnsCount = ROWS_COUNT;
uint mRowsCount = COLUMNS_COUNT;
uint mTotalColumnsCount = TOTAL_COLUMNS_COUNT;
mViewList = new global::System.Collections.Generic.LinkedList<View>();
mTimerList = new global::System.Collections.Generic.LinkedList<Timer>();
+ mAnimationList = new global::System.Collections.Generic.LinkedList<Animation>();
mWindow = Window.Instance;
mWindow.BackgroundColor = Color.White;
animation.Finished += OnAnimationFinished;
animation.Play();
+ mAnimationList.AddLast(animation);
+
endTime = DateTime.Now;
mCreationStatistic.add((endTime - startTime).TotalMilliseconds);
mTimerList.First.Value.Dispose();
mTimerList.RemoveFirst();
+ // Dereference animation safety
+ mAnimationList.RemoveFirst();
+
deleteCount++;
+ Animation me = o as Animation;
+ me.Dispose();
+
// If all views are deleted, quit this application. byebye~
if(deleteCount == mTotalColumnsCount * (int)ViewTestType.TEST_TYPE_MAX)
{
appEndTime = DateTime.Now;
Tizen.Log.Error("NUI.PerfNew", $"Duration of all app running time : {((appEndTime - appStartTime)).TotalMilliseconds} ms\n");
Deactivate();
+ FullGC();
Exit();
}
}
[STAThread] // Forces app to use one thread to access NUI
static void Main(string[] args)
{
- PerfNewExample example = new PerfNewExample();
+ PerformanceTestExample example = new PerformanceTestExample();
example.Run(args);
}
-}
\ No newline at end of file
+}
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="org.tizen.example.Tizen.NUI.PerfNew" version="1.0.0">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="org.tizen.example.Tizen.NUI.PerformanceTest" version="1.0.0">
<profile name="common" />
- <ui-application appid="org.tizen.example.Tizen.NUI.PerfNew"
- exec="PerfNew.dll"
- type="dotnet"
+ <ui-application appid="org.tizen.example.Tizen.NUI.PerformanceTest"
+ exec="PerformanceTest.dll"
+ type="dotnet-nui"
multiple="false"
taskmanage="true"
nodisplay="false"
launch_mode="single"
>
- <label>Tizen.NUI.PerfNew</label>
- <icon>Tizen.NUI.PerfNew.png</icon>
+ <label>Tizen.NUI.PerformanceTest</label>
+ <icon>Tizen.NUI.PerformanceTest.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
</manifest>