C
C#ā€¢3mo ago
unknow$

Why do requests slow down the program so much?

As I mentioned in the title, I have a multi-threading system. It uses 100% of my processor. My program makes about 1200 checks per second, but when I add the part where I need to send requests to the system, it makes almost 40, 50 checks per second and uses %5 of my processsor The response time to my request is very short, I don't understand why this is happening. Is there any way I can fix this?
No description
20 Replies
Angius
Angiusā€¢3mo ago
What requests? What system? How do you make those requests? Why do you even need to send 1200 requests a second?
Pobiega
Pobiegaā€¢3mo ago
Looks like htto requests, which would mean you are not limited by cpu
unknow$
unknow$ā€¢3mo ago
ill send video one sec
Angius
Angiusā€¢3mo ago
Uh, sure? I'd rather see code, but aight, make a video
unknow$
unknow$ā€¢3mo ago
check dm
Angius
Angiusā€¢3mo ago
No My DMs are and will forever remain closed
unknow$
unknow$ā€¢3mo ago
alright
funwithmetamil
funwithmetamilā€¢3mo ago
Which backend you use?
unknow$
unknow$ā€¢3mo ago
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()); }
Angius
Angiusā€¢3mo ago
Wait, am I seeing this right? You're trying to bruteforce valid Bitcoin wallet addresses and keys? :KEKW:
unknow$
unknow$ā€¢3mo ago
absolutely wrong šŸ˜…
funwithmetamil
funwithmetamilā€¢3mo ago
That's hard
unknow$
unknow$ā€¢3mo ago
Why is this happening do u have a idea
funwithmetamil
funwithmetamilā€¢3mo ago
Bro if you have Quantum computer it may be possible
unknow$
unknow$ā€¢3mo ago
I'm aware, man, I'm just wondering why the processing speed of the program has decreased in this way.
Pobiega
Pobiegaā€¢3mo ago
Because you don't understand what await does. Regardless, this is clearly a btc bruteforce attempt.
unknow$
unknow$ā€¢3mo ago
How long can the wait be?
Pobiega
Pobiegaā€¢3mo ago
creating and sending a request, waiting for a response, processing the response. thats what happens with await client.GetStringAsync
Patrick
Patrickā€¢3mo ago
!ban @unknow$ nefarious software development, brute forcing
Angius
Angiusā€¢3mo ago
Oh come on, if we helped him finish it we would all be rich šŸ˜›