-
Notifications
You must be signed in to change notification settings - Fork 567
Runtime startup performance improvements #2515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,15 +152,16 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args) | |
| { | ||
| Logger.Categories = (LogCategories) args->logCategories; | ||
|
|
||
| var __start = new DateTime (); | ||
| Stopwatch stopper = null; | ||
| long elapsed, totalElapsed = 0; | ||
| if (Logger.LogTiming) { | ||
| __start = DateTime.UtcNow; | ||
| Logger.Log (LogLevel.Info, | ||
| "monodroid-timing", | ||
| "JNIEnv.Initialize start: " + (__start - new DateTime (1970, 1, 1)).TotalMilliseconds); | ||
| Logger.Log (LogLevel.Info, | ||
| "monodroid-timing", | ||
| "JNIEnv.Initialize: Logger JIT/etc. time: " + (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalMilliseconds + " [elapsed: " + (DateTime.UtcNow - __start).TotalMilliseconds + " ms]"); | ||
| stopper = new Stopwatch (); | ||
| stopper.Start (); | ||
| Logger.Log (LogLevel.Info, "monodroid-timing", "JNIEnv.Initialize start"); | ||
| elapsed = stopper.ElapsedMilliseconds; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should call
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's restarted a few lines after that. Calling |
||
| totalElapsed += elapsed; | ||
| Logger.Log (LogLevel.Info, "monodroid-timing", $"JNIEnv.Initialize: Logger JIT/etc. time: elapsed {elapsed} ms]"); | ||
| stopper.Restart (); | ||
| } | ||
|
|
||
| gref_gc_threshold = args->grefGcThreshold; | ||
|
|
@@ -195,16 +196,14 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args) | |
| #endif // JAVA_INTEROP | ||
|
|
||
| if (Logger.LogTiming) { | ||
| var __end = DateTime.UtcNow; | ||
| Logger.Log (LogLevel.Info, | ||
| "monodroid-timing", | ||
| "JNIEnv.Initialize: time: " + (__end - new DateTime (1970, 1, 1)).TotalMilliseconds + " [elapsed: " + (__end - __start).TotalMilliseconds + " ms]"); | ||
| __start = DateTime.UtcNow; | ||
| elapsed = stopper.ElapsedMilliseconds; | ||
| totalElapsed += elapsed; | ||
| Logger.Log (LogLevel.Info, "monodroid-timing", $"JNIEnv.Initialize: managed runtime init time: elapsed {elapsed} ms]"); | ||
| stopper.Restart (); | ||
| var _ = Java.Interop.TypeManager.jniToManaged; | ||
| __end = DateTime.UtcNow; | ||
| Logger.Log (LogLevel.Info, | ||
| "monodroid-timing", | ||
| "JNIEnv.Initialize: TypeManager init time: " + (__end - new DateTime (1970, 1, 1)).TotalMilliseconds + " [elapsed: " + (__end - __start).TotalMilliseconds + " ms]"); | ||
| elapsed = stopper.ElapsedMilliseconds; | ||
| totalElapsed += elapsed; | ||
| Logger.Log (LogLevel.Info, "monodroid-timing", $"JNIEnv.Initialize: TypeManager init time: elapsed {elapsed} ms]"); | ||
| } | ||
|
|
||
| AllocObjectSupported = androidSdkVersion > 10; | ||
|
|
@@ -238,10 +237,10 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args) | |
| Java.Lang.Thread.DefaultUncaughtExceptionHandler = defaultUncaughtExceptionHandler; | ||
| } | ||
|
|
||
| if (Logger.LogTiming) | ||
| Logger.Log (LogLevel.Info, | ||
| "monodroid-timing", | ||
| "JNIEnv.Initialize end: " + (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalMilliseconds); | ||
| if (Logger.LogTiming) { | ||
| totalElapsed += stopper.ElapsedMilliseconds; | ||
| Logger.Log (LogLevel.Info, "monodroid-timing", $"JNIEnv.Initialize end: elapsed {totalElapsed} ms"); | ||
| } | ||
| } | ||
|
|
||
| internal static void Exit () | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package mono.android.app; | ||
|
|
||
| public class XamarinAndroidEnvironmentVariables | ||
| { | ||
| // Variables are specified the in "name", "value" pairs | ||
| public static final String[] Variables = new String[] { | ||
| //@ENVVARS@ | ||
| }; | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.