-
Notifications
You must be signed in to change notification settings - Fork 349
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
Update ExecutionEnvironment to cache command line #680
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
/// <summary> | ||
/// Cached lower case CommandLine | ||
/// </summary> | ||
private static string Cached_Environment_CommandLine_Lower = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a constant so name should not use underscore notation.
/// <summary> | ||
/// Whether the editor was started in batch mode. | ||
/// </summary> | ||
public static bool InBatchMode { | ||
get { return Environment.CommandLine.ToLower().Contains("-batchmode"); } | ||
get { return Environment_CommandLine_Lower.Contains("-batchmode"); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better than before but couldn't you just read all three of the switches it's interested in inside a constructor and just return booleans in the properties? This still runs unnecessary string operations every frame.
This has to be merged in. Is the jar resolver maintained anymore or has Google sunset Unity support? The editor is constantly allocating memory which makes long-running automated test running inside editor slow down over time etc. Of course you can't read the command line every frame, read it once like this pull request does. Merge it in now please. |
@paulinon @a-maurice Could you just approve this as it is not ok that the resolver constantly allocates memory every frame. |
Simple fix for unnecessary GC Allocation using command line
See #428