In order to improve investiny's performance when retrieving historical data from Investing.com when the specified intervals imply retrieving data greater than 5000 points, we'll be using httpx with asyncio so as to make sure that those requests are run asynchronously rather than inside a for-loop.
We'll run a simple benchmark once done so as to compare both approaches to see which one performs better.
In order to improve
investiny
's performance when retrieving historical data from Investing.com when the specified intervals imply retrieving data greater than 5000 points, we'll be usinghttpx
withasyncio
so as to make sure that those requests are run asynchronously rather than inside a for-loop.We'll run a simple benchmark once done so as to compare both approaches to see which one performs better.
More information at https://www.twilio.com/blog/asynchronous-http-requests-in-python-with-httpx-and-asyncio courtesy of @sagnew