Closed UselessGuru closed 6 years ago
This does need speeding up; I'll consider your suggestions.
How is '{$_.SSL -EQ $SSL}' in your original code below supposed to work? I assume it is ment to allow only SSL or NON-SSL pools in the resulting $Pool array, but not both. If I don't use '-SSL' ( -> $SSL=$true) as parameter, $Pools will still contain pools with SSL=False Is this intended?
$AllPools.Algorithm | ForEach-Object {$_.ToLower()} | Select-Object -Unique | ForEach-Object {$Pools | Add-Member $_ ($AllPools | Sort-Object -Descending {$PoolName.Count -eq 0 -or (Compare-Object $PoolName $_.Name -IncludeEqual -ExcludeDifferent | Measure-Object).Count -gt 0}, Price, {$_.Region -EQ $Region}, {$_.SSL -EQ $SSL} | Where-Object Algorithm -EQ $_ | Select-Object -First 1)}
$AllPools.Algorithm | ForEach-Object {$_.ToLower()} | Select-Object -Unique | ForEach-Object {$Pools_Comparison | Add-Member $_ ($AllPools | Sort-Object -Descending {$PoolName.Count -eq 0 -or (Compare-Object $PoolName $_.Name -IncludeEqual -ExcludeDifferent | Measure-Object).Count -gt 0}, StablePrice, {$_.Region -EQ $Region}, {$_.SSL -EQ $SSL} | Where-Object Algorithm -EQ $_ | Select-Object -First 1)}
Yes, I don't actually remove any pools; I simply sort them in order of preference.
I've been measuring a few command times before calling it a night and the main speed problem is in the two lines that you have just quoted. The number of pools need reducing before sorting.
My aims are:
Static values per pool
$Wallet = "3QYQg9JwVSvTTwpAdfaXJe2jQPC8JhG4X8" $WorkerName = "1080ti" # max. 7 chars $Currency = "BTC" if (-not $WorkerName) {$WorkerName = $env:computername} If ($WorkerName.Length -gt 7) {$WorkerName = $WorkerName.substring(0,7)} $Password = "x" $URL = "http://api.nicehash.com/api?method=simplemultialgo.info"
$Nicehash_Regions = "eu", "usa", "hk", "jp", "in", "br"
$Nicehash_Regions = "eu" ...
...
In case some algos are not working properly
$DisabledAlgorithms = @("cryptonight","sia","scrypt")
$NiceHash_Request.result.simplemultialgo | ForEach-Object {
...
...
Make SSL either true or false, will not be empty after this
$SSL = (-not -not $SSL) if ($SSL) {$protocol = "stratum+ssl"} else {$protocol = "stratum+tcp"} ... $NiceHash_Host = "nicehash.com" $NiceHashPort = $.port $NiceHash_Algorithm_Norm = Get-Algorithm $NiceHash_Algorithm $NiceHash_Coin = ""
}