I posted PowerShell, An Exercise in Species Barcoding and began coding up the metric for measuring the difference between two sequences of characters for the genomes. There are ~1250 sequences. Comparing each means 1,562,500 comparisons.
I tested empty loops with inner loops. Looping 500 times in each. The Inline C# version 1,500 times, doing three times as many loops as the the other and performing significantly faster.
It’s not unexpected that C# is fastest. It’s great that PowerShell provides the Add-Type cmdlet which can compile C# inline. Add-Type can do even more. You can compile VB.Net and F# too. Try help Add-Type –Examples at the command line and check out the possibilities.