Skip to content

Commit

Permalink
Optimizations to the calltree under ExpandPropertiesLeaveEscaped - PR #…
Browse files Browse the repository at this point in the history
…6128

Context
Property expansion has been identified as one of the hot spots in project evaluation and ExpandPropertiesLeaveEscaped alone
accounts for almost 20% of overall evaluation time of simple projects.
Several optimizations have been made to the calltree under ExpandPropertiesLeaveEscaped. Notably:
- Unnecessary and counter-productive string pinning has been removed.
- A slow strchr-like function has been replaced with a simple call to String.IndexOf.
- Series of ifs have been replaced with a switch.
- Allocation of List<object> results has been eliminated.
- Allocation of temporary substrings extracted from the expression has been eliminated.
- The combined performance win is 10% in ExpandPropertiesLeaveEscaped, so close to 2% for evaluation overall.
  • Loading branch information
rokonec committed Mar 3, 2021
2 parents 746f19b + 86b65b7 commit cbca164
Show file tree
Hide file tree
Showing 4 changed files with 265 additions and 163 deletions.

0 comments on commit cbca164

Please sign in to comment.