Comments (11)
I just submitted a pull request which should improve historical data retrieval performance.
from yahoofinanceapi.
I don't know postman at all. is it this tool: Postman ?
How much longer it takes ?
What I can notice in my application is that the first query threw Yahoo Api takes a little bit longer (due to fetching cookie & curl) the next request are quite fast. (when working on same process without disposing the previous api context obj so cookie & curl could be reused)
from yahoofinanceapi.
@delvier Yes that's the Postman im talking about.
Postman request is about 300ms whereas the library is taking anywhere from 500ms to 1second.
Whats the optimum lifetime for a class using this library? I currently use a single class to handle calling this library and that class is a Scoped instance so only lasting for the request. Would it be of greater performance to be a singleton for the lifetime of the application?
from yahoofinanceapi.
@ntrous
I wonder how exactly you calling the query. Is it console application or GUI ?
The yahoo client have internal singleton already implemented - it's flurl client obj. which is main caller for all post requests.
I believe your postman query have already Curl within your URI request so it's 1 request, whereas the Yahoo have to obtain that Cookie&Curl for the first accessed query.
Well I believe there is no need for special management of life cycle of your class because you use Singleton indirectly by using this library.
I performed UnitTest - the first query around 1s. second 470ms.
Query Code:
var dataList = _sut.GetPrice("INTC", new DateTime(2015, 1, 2), DateTime.Today);
var dataList2 = _sut.GetPrice("INTC", new DateTime(2015, 1, 2), DateTime.Today
from yahoofinanceapi.
@delvier I'm using this library for a website where i'm doing some complex calculations and when there are many Symbols to lookup each query taking 500ms to 1sec is starting to add up a lot. Even when running them async it's taking some time.
I may have to take a look at the source code myself and see if I can perform any optimisations.
from yahoofinanceapi.
@ntrous
Strange that each query takes the same in case of web application.
I'm newbie to web application but maybe someone can clear it out.
I'm able to query 1000 symbols within 1 minute. (which is fast enough for my needs)
Each query ask for 2 years of historical data.
Using my WPF desktop application and default parallel approach.
from yahoofinanceapi.
@ntrous @delvier I've merged @dshe works & updated the package on nuget. Please update accordingly & check if there's any problem with it, thank you 😄
from yahoofinanceapi.
Is this fix in the latest 2.0.0 version on nuget?
from yahoofinanceapi.
Yes, the latest code is in the latest nuget package, version 2.0.0.
from yahoofinanceapi.
It definitely looks to be a bit quicker. an operation I'm running that takes roughly 8 seconds is now taking 7 seconds, so that's something!
from yahoofinanceapi.
@ntrous if the issue is solved, would you mind I close the issue?
from yahoofinanceapi.
Related Issues (20)
- Dividend Date HOT 1
- Exchange rate? HOT 1
- DividendDate issue HOT 1
- Empty dictionary? HOT 2
- stock split before after data is always zero HOT 4
- Can I retrieve historical data by hour?
- Exception: Failure to create client HOT 27
- Is 3.0.0-beta3 the final version?
- v7 API now breaks with "code":"Unauthorized","description":"Invalid Cookie" HOT 16
- Failed with status code 403 on Android HOT 1
- Premarket data HOT 1
- Error Too Many Requests HOT 6
- Failing with Status code 502 since Dec 4? HOT 14
- Flurl.Http dependencies issues HOT 1
- Call failed with status code 500 HOT 1
- FlurlHttpException with StatusCode: 429, ReasonPhrase: 'Too Many Requests' HOT 10
- Error code 500 (Cannot find server.): GET https://fc.yahoo.com HOT 2
- Stock split question HOT 1
- Can't install nuget: Cycle Detected
- Flurl.Http.FlurlHttpException: 'Call failed with status code 429 (Too Many Requests): HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yahoofinanceapi.