This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Programmatic use of SharePoint has generally always been a pain in my experience.
I would suggest checking with whoever handles your network infastructure to make sure that the connection to SharePoint is set up in the most optimal way. Sometimes there are settings on the SP server side that can be adjusted (is what I've heard from some folks who work on SP servers where I work).