Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVE] Increase the speed behind loading stock data #3699

Closed
DidierRLopes opened this issue Dec 4, 2022 · 3 comments
Closed

[IMPROVE] Increase the speed behind loading stock data #3699

DidierRLopes opened this issue Dec 4, 2022 · 3 comments
Labels
enhancement Enhancement

Comments

@DidierRLopes
Copy link
Collaborator

I believe that additional_info_about_ticker function is responsible by most of this lag. I personally don't use that quick overview and find it annoying that it takes me this long to load data because of it. I think for default it shouldn't.

See quick inspection below,
Screenshot 2022-12-04 at 13 14 00

@DidierRLopes DidierRLopes added the enhancement Enhancement label Dec 4, 2022
@victortangggg
Copy link
Contributor

hey @DidierRLopes I found a potential solution:

I see that the bottleneck is in the API call. By using yf.Ticker(ticker).stats() instead of yf.Ticker(ticker).info, the time taken is cut significantly
image
image

this is backed up by a closed issue from the yfinance project - ranaroussi/yfinance#851

let me know what you think. I will create a PR if team is happy with it.

@DidierRLopes
Copy link
Collaborator Author

Hey @victortangggg,

I didn't know this! This is definitely an improvement!

Yes, please. Feel free to go ahead with the fix :)

victortangggg added a commit to victortangggg/OpenBBTerminal that referenced this issue Dec 4, 2022
replace yfinance api call with stats to cut loading time
@victortangggg
Copy link
Contributor

thanks! PR is here - #3700

jmaslek added a commit that referenced this issue Dec 5, 2022
replace yfinance api call with stats to cut loading time

Co-authored-by: James Maslek <jmaslek11@gmail.com>
Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
@jmaslek jmaslek closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants