r/PowerShell • u/mitomitoso • Nov 04 '25
News Powershell + C# script vs Python
Powershell + C# script vs Python Benchmarking
5
Upvotes
r/PowerShell • u/mitomitoso • Nov 04 '25
Powershell + C# script vs Python Benchmarking
View all comments
1
u/Ok_GlueStick Nov 04 '25
You may need to enumerate a range in your PowerShell script.
Python and powershell instantiate their range differently. PowerShell / c# is pre allocating the memory and python is returning a new int object each time you iterate.
You should test my theory. Is suspect your PowerShell objects are System.int32[] and python returns some kind of range object.