Powershell: Performance improvements: revisit operator-invocation code in Compiler.cs or clean up obsolete comments

Created on 26 Feb 2019  路  4Comments  路  Source: PowerShell/PowerShell

Compiler.cs contains many source-code comments such as the following:

https://github.com/PowerShell/PowerShell/blob/81d37fcb84c812e077c79623d8a1a6416207b196/src/System.Management.Automation/engine/parser/Compiler.cs#L5160-L5165

relating to many common operators.

It's worth revisiting the code there to see if across-the-board performance gains are to be had.

_Update_: @iSazonov comments:

I remember Jason commenting to me that we could remove the TODO comments because perhaps there does not exist direct and simple performance optimizations.

In that event, this issue can serve as a reminder to _remove these comments_.

Issue-Enhancement

Most helpful comment

I express no preference here on either the comments or issue.

It could be a good opportunity to explore dynamic sites as they are implemented elsewhere, but improvements might only be meaningful in micro-benchmarks.

All 4 comments

The Issue does not have utility if you do not intend to enumerate all options and explore them.

if you do not intend to enumerate all options

_Perhaps_ a common optimization - if any - can be applied to all locations where these source-code comments appear, but I personally have no idea.

and explore them.

I cannot personally explore them, but this issue has utility as a _general reminder_ to someone who can.

And perhaps the only action needed is to simply remove the comments, after all.
/cc @lzybkr

I express no preference here on either the comments or issue.

It could be a good opportunity to explore dynamic sites as they are implemented elsewhere, but improvements might only be meaningful in micro-benchmarks.

@lzybkr Do we have any concrete examples in the code base where we've implemented perf optimizations with call sites and dynamic operands? Very curious about this, and I understand the concept and can do some simple things, but nothing too crazy and it would be nice with some existing references :)

Was this page helpful?
0 / 5 - 0 ratings