-
Notifications
You must be signed in to change notification settings - Fork 13
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
Performance Issue with 3.3.0 #13
Comments
Thanks for the notification. |
Note that the readme has changed. Dynamic functions should still work (but I suspect there might a bug here),, smart properties are actually strings (e.g.: LeftJoin $Employee -On ReportsTo -Equals Id -Property @{ Name = 'Left.Name' }, @{ Manager = 'Right.Name' } |
Missing propertiesI am not able to reproduce the missing properties issue on either version PS C:\> LeftJoin $Employee -On ReportsTo -Equals Id -Property @{ Name = {$Left.Name} }, @{ Manager = {$Right.Name} }
Name Manager
---- -------
Aerts Evans
Bauer Duval
Cook Aerts
Duval Evans
Evans
Fischer Duval Can you supply more information on environment you using ( PerformanceWith regards to the performance issue, I am able to reproduce the performance issue using property expressions: $Employee = foreach ($id in 1..9999) {
[pscustomobject]@{
Id = $Id
Name = "Name$Id"
Country = "Country$Id"
Department = "Department$Id"
Age = $Id
ReportsTo = $Id % 8
}
} Version (Measure-Command {
LeftJoin $Employee -On ReportsTo -Equals Id -Property @{ Name = {$Left.Name} }, @{ Manager = {$Right.Name} }
}).TotalSeconds
2.4010024 Version (Measure-Command {
LeftJoin $Employee -On ReportsTo -Equals Id -Property @{ Name = {$Left.Name} }, @{ Manager = {$Right.Name} }
}).TotalSeconds
3.0639778 But if I actually use smart properties, there is hardly any performance difference between both versions: (Measure-Command {
LeftJoin $Employee -On ReportsTo -Equals Id -Property @{ Name = 'Left.Name' }, @{ Manager = 'Right.Name' }
}).TotalSeconds
2.5031613 There are two changes/features causing the performance degradation on property expressions:
$Name = 'Name"
LeftJoin $Employee -On ReportsTo -Equals Id -Property @{ Name = {$Left[$Name]} }, @{ Manager = {$Right[$Name]} } I don't think I will be able to fix this. |
I have closed the issue as the performance degradation is caused by some new few features (smart properties) that could be use instead. |
The performance degradation was caused by the expensief function calls required for the ""smart property** feature (see also this discussion: Optimize static code reusage #19322). |
Version 3.3.0 is significantly slower than 3.2.2. However, 3.2.2, seems to have a bug where the Smart Properties and special variables for the
-Property
parameter do not work. They always return $null, whether using{$Left.Name}
or{$RightIndex}
, etc. They always return $null results.On doing a LeftJoin of two tables with about 2,000 records each, on a single ComputerName property, 3.2.2 takes less than 3 seconds to return the results. 3.3.0 takes about 10 seconds.
I was going to put in the below Issue before I realized I was on an old version (3.2.2). But the new (3.3.0) version is so slow, I don't think I can use it. Here was the issue I was going to put in for 3.2.2:
I haven't been able to get any of the Smart Properties or special variables to work on the
-Property
parameter.Using Example 4 listed on the Readme:
The weird thing is that if I highlight/select the output in the ISE, it shows what looks like whitespace wherever there is supposed to be a manager listed, but skips the line where it's not supposed to have one. Almost like it knows that Evans doesn't have a manager.
This is all fixed in 3.3.0, but the performance is 3-5x slower.
The text was updated successfully, but these errors were encountered: