Giter Club home page Giter Club logo

Comments (6)

pranjal-joshi avatar pranjal-joshi commented on May 27, 2024

Glad hearing from you! 👍🏼

Sure you can implement multiprocessing. Please go through Contributing Guidelines to get started.

My primary observation is Majority of the time consumed by yfinance module to for downloading stock data depending on the network speed and it's internally using multiple threads by default.

If you successfully implement multiprocessing, please try to post time consumed difference between new code and existing single core just for comparison.

from screeni-py.

pranjal-joshi avatar pranjal-joshi commented on May 27, 2024

Currently, the code uses a single-core to do the screening. but we can run it in parallel to make it faster.
I changed file screenipy.py to use all cores using the multiprocessing module.
Can I make PR?
I will create a new file named screenipy_parallel.py so that your original code does not break.

Also while posting PR, please modify your code in screenipy.py file and send PR to new-features branch.
This will automatically run the test cases before merging. Feel free to add more test cases in test folder if required.

from screeni-py.

pranjal-joshi avatar pranjal-joshi commented on May 27, 2024

@swarpatel23
Here are some timing details that I observed for each iteration (Running on Core-i5 (2.4GHz)):

  1. Data Fetching time for each stock (Network Dependent) = 0.25 to 0.5 Sec For this call
  2. Data Processing/Analysis time for each stock = 0.125 Sec From this to this

So it would be great if you can run analysis and fetching as 2 different processes and the Fetching should feed the received data to the analysis process while fetching for the next stock code.

from screeni-py.

swarpatel23 avatar swarpatel23 commented on May 27, 2024

The approach that I tried is that stock symbols are equally distributed among all processes.

I ran code with option 1: Screen stocks for Breakout or Consolidation

For sequential code, it took: 26 minutes 54 seconds
For parallel code, it took (8 processes): 4 minutes 35 seconds

The problem that I have is that because processes do not share a state so "screenCounter" does not work as expected.

from screeni-py.

pranjal-joshi avatar pranjal-joshi commented on May 27, 2024

The time difference measured by you seems like a fantastic improvement.

Before we merge, Can you please look at multiprocessing.Value to fix screenCounter issue? With Value instances of variable can be shared with multiple processes.

Looking forward to merge #44 👍🏼

from screeni-py.

pranjal-joshi avatar pranjal-joshi commented on May 27, 2024

After further development for using multiprocessing on Windows with pyinstaller, the binaries released for #44 in 2d4299d (v1.14)

from screeni-py.

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.