Closed Beeifys closed 2 days ago
Asking the obvious: Have you tried deactivating your anti virus or even better add an exclusion rule for the directory where you develop?
This will not just get rid of almost any runtime performance problems, but also improve your compile speed.
Closing for no response.
Description
Why my cpu very high on Anti Malware Executable, when i use cpr with thread pool to scraping a websites. Im compiled my executable use Visual Studio 2019 on Windows. Any solution for it?
My software cpu usage:![image](https://github.com/libcpr/cpr/assets/102404156/32c22b35-68c5-498b-a416-d720fea2e4d1)
Picture of high cpu:![image](https://github.com/libcpr/cpr/assets/102404156/624844ee-9e57-4cce-bf6d-76361d145699)
Example/How to Reproduce
My GET requests code (just part of my code not included some variable on it): cpr::Session session; session.SetUrl(cpr::Url(fullUrl)); session.SetVerifySsl(false); session.SetTimeout(cpr::Timeout{ 30000 });
My post request code (just part of my code not included some variable on it): session.SetUrl(cpr::Url{ fullUrl }); cpr::Header headers = customHeaders; if (headers.empty()) { headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"; headers["Content-Type"] = contentType; } else { headers["Content-Type"] = contentType; } session.SetHeader(headers); session.SetBody(cpr::Body(postBody)); session.SetCookies(cpr::Cookies(customCookies)); return session.Post();
Possible Fix
No response
Where did you get it from?
vcpkg
Additional Context/Your Environment