-
Notifications
You must be signed in to change notification settings - Fork 45
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
Major Roslyn Improvements to Memory and Running Time #25
Conversation
…ession to a flat 25MB plus 0.3MB~ per unique expression. Running time of first execution down from 2 seconds for each unique expression to a flat 2 seconds plus 15ms per unique expression.
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.
if (forgeState == null) throw new ArgumentNullException("forgeState"); | ||
if (callbacks == null) throw new ArgumentNullException("callbacks"); | ||
if (token == null) throw new ArgumentNullException("token"); | ||
|
||
this.SessionId = sessionId; | ||
this.JsonSchema = jsonSchema; | ||
this.ForgeTree = forgeTree; |
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.
just to confirm, looks like you just switched line 140-152 with line 169-181. Besides these, only some comments are changed, right? #Closed
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.
I swapped the constructors to put the ForgeTree one on top. Just because it is preferred to use that one. No functional changes.
In reply to: 470868342 [](ancestors = 470868342)
/// </summary> | ||
private List<Type> dependencies; | ||
public static string ParentScriptCode = "(1+1).ToString()"; |
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.
"(1+1).ToString()" [](start = 48, length = 18)
nit: consider to add the comment why to add the NO-OP statement. #Closed
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.
I've outlined the various feature improvements on the new fields/properties. I describe more about the parentScript below. I didn't do deep investigation into how or why adding code here works. I just noticed it in the testing. It didn't matter too much what the code I put here was. I seemed to get slightly better times if the logic here matched the first executed expression logic, such as doing arithmetic. But since the improvements were small and it entirely depends on the unique ForgeTree that each application uses, I don't think its worth any more investment to investigate and improve.
In reply to: 470868792 [](ancestors = 470868792)
|
||
/// <summary> | ||
/// Roslyn script options. | ||
/// The ScriptCache is used to cache and re-use Roslyn scripts. | ||
/// Scripts include the parentScript, as well as all unique expressions that get Executed. | ||
/// </summary> |
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.
[](start = 12, length = 10)
consider to add your comment in the code review description:
ScriptCache now caches Scripts that come from the parentScript.ContinueWith. ScriptCache still caches one Script per unique Expression, but these no longer get compiled. #Closed
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.
actually, consider to add your code review comments here, starting with "Roslyn Improvements Summary:....". Those perf numbers are good reference/baseline for future improvement if needed. #Closed Refers to: Forge.TreeWalker/src/ExpressionExecutor.cs:24 in 9ed42b2. [](commit_id = 9ed42b2, deletion_comment = False) |
The history of this PR will not go away, so we can look back in the description to find the original notes if needed. In reply to: 674277179 [](ancestors = 674277179) Refers to: Forge.TreeWalker/src/ExpressionExecutor.cs:24 in 9ed42b2. [](commit_id = 9ed42b2, deletion_comment = False) |
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.
Roslyn Improvements Summary:
Feature breakdown:
ParentScript
ParentScriptTask
ParentScriptCode
ScriptCache rework
MetadataReferenceResolver