Giter VIP home page Giter VIP logo

Comments (11)

dshe avatar dshe commented on July 30, 2024 3

I just submitted a pull request which should improve historical data retrieval performance.

from yahoofinanceapi.

pljanot avatar pljanot commented on July 30, 2024

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.

ntrous avatar ntrous commented on July 30, 2024

@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.

pljanot avatar pljanot commented on July 30, 2024

@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.

ntrous avatar ntrous commented on July 30, 2024

@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.

pljanot avatar pljanot commented on July 30, 2024

@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.

karlwancl avatar karlwancl commented on July 30, 2024

@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.

ntrous avatar ntrous commented on July 30, 2024

Is this fix in the latest 2.0.0 version on nuget?

from yahoofinanceapi.

dshe avatar dshe commented on July 30, 2024

Yes, the latest code is in the latest nuget package, version 2.0.0.

from yahoofinanceapi.

ntrous avatar ntrous commented on July 30, 2024

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.

karlwancl avatar karlwancl commented on July 30, 2024

@ntrous if the issue is solved, would you mind I close the issue?

from yahoofinanceapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.