unknow$
Why do requests slow down the program so much?
for (int i = 0; i < Environment.ProcessorCount; i++)
{
Thread thread = new Thread(async() =>
{
while (true)
{
string mnemonicPhrase = new Mnemonic(Wordlist.English, WordCount.Twelve).ToString();
ExtKey masterKey = new Mnemonic(mnemonicPhrase).DeriveExtKey();
ExtKey btcPrivateKey = masterKey.Derive(keyPath_btc);
PubKey pubKey_btc = btcPrivateKey.PrivateKey.PubKey;
var btc_Address = pubKey_btc.GetAddress(ScriptPubKeyType.Legacy, Network.Main);
Interlocked.Increment(ref localcheck);
Console.WriteLine($"{localcheck} \n Address : {btc_Address} \n");
}
});
thread.Start();
}
In this state, the program can generate more than 1000 addresses per second.
But when I add a request section to the program, this rate fall significantly.
request section;
try
{
string btc_Response = await client.GetStringAsync($"https://------/{btc_Address}");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
29 replies